Community
Participate
Working Groups
Snippet294 is supposed to create a non-rectangular button. Works fine on Windows but not on Linux.
Upon investigation, this bug only happens in GTK3, and not GTK2. However, the reasoning behind why this doesn't work anymore is actually a design change by the GTK+ library. Currently, setRegion() calls use gtk_widget_shape_combine_region() to grab the GDKWindow that the button is drawing to and add the region layer on it, changing the shape. GTK3 has so that widgets are not drawn on the GDKWindow layer anymore, meaning the gdk_window_shape_combine_region() call is not working. After some discussion with the GTK team, we should not be changing the GTKButton shape in the first place as GTK3 focus is for us to use CSS for any styling. CSS has big limitations to what we can do, especially changing what a buttons shape is. In order to do so, we would have to create a custom widget instead to support setRegion for buttons, which is not an easy or quick task to do for which otherwise our current implementation of button is working fine. I don't believe this is a big enough problem to proportion time into re-implementing unfortunately.
(In reply to Ian Pun from comment #1) > After some discussion with the GTK team, we should not be changing the > GTKButton shape in the first place I *love* to read such statements from GTK team, they always know better what is good for all their clients. > as GTK3 focus is for us to use CSS for > any styling. Do you mean GTK3 CSS or e4 CSS? I guess GTK3 one, which will add even more code working only with a specific GTK3 version, sometimes, may be, on some Linux distros, until the next minor GTK3 version... > CSS has big limitations to what we can do, especially changing > what a buttons shape is. In order to do so, we would have to create a custom > widget instead to support setRegion for buttons, which is not an easy or > quick task to do for which otherwise our current implementation of button is > working fine. I don't believe this is a big enough problem to proportion > time into re-implementing unfortunately. Sad to hear that. SWT and cross-platform development is becoming really hard. I know that this is not your fault, and that resources are limited, it is just really disappointing to see all that GTK3 issues.
Looks to me that Labels have the same issue. Ian is this a general issue for all widgets running under GTK?
(In reply to Lars Vogel from comment #3) > Looks to me that Labels have the same issue. Ian is this a general issue for > all widgets running under GTK? Yes it is unfortunately. All widgets in GTK3 have moved away on drawing on GDKWindow so, in that effect, it doesnt work.
IMHO this is a major issue, as it affects cross-platform development. It is also a regression as it worked with GTK2.
(In reply to Lars Vogel from comment #5) > IMHO this is a major issue, as it affects cross-platform development. It is > also a regression as it worked with GTK2. I think this is a pretty big issue, but it's very difficult to fix as we are heavily limited by the changes in the new GTK3 libraries. Lars, do you have any suggestions at what we could do to resupport this besides building more custom widgets?
*** This bug has been marked as a duplicate of bug 529431 ***