Bug 23569

Summary: [Gtk] Non-rectangular buttons have a square background behind them
Product: WebKit Reporter: Andrea Cimitan <andrea.cimitan>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bearoso+webkitbugzilla, jmalonzo, mrobinson, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Linux   
Attachments:
Description Flags
Patch to fix buttons
none
Patch for this issue none

Description Andrea Cimitan 2009-01-27 06:52:55 PST
Both buttons and entries have a squared border in webkitgtk.
For the entry, there's gtk style property that could be added to the widget in order to tell the theming engine to not draw the background.
Here is the mozilla patch, which will land in firefox 3.1:
https://bugzilla.mozilla.org/show_bug.cgi?id=405421

I don't know that happenes with the buttons (they were already working correctly in gecko), but they have a squared rectangle below, which of course looks out of place
Comment 1 Xan Lopez 2009-03-17 06:19:34 PDT
We seem to have this patch in our gtk2drawing.c already. Any idea of what could be going on?
Comment 2 Jan Alonzo 2009-04-26 02:06:37 PDT
(In reply to comment #1)
> We seem to have this patch in our gtk2drawing.c already. Any idea of what could
> be going on?
> 

honor-transparent-bg-hint is only for GtkEntry based on the moz code and the discussion in the bug. I think we need to do this for GtkButton as well.
Comment 3 Brandon Wright 2009-11-01 17:38:51 PST
Created attachment 42286 [details]
Patch to fix buttons

This one is far too easy for how long it's gone unfixed. Attached patch fixes the problem by not filling the background on buttons (the theme should be doing it anyhow, if necessary). Patch is against 1.1.15.2, but works on trunk, too.
Comment 4 Brandon Wright 2009-11-01 18:01:20 PST
Additionally, line 871 of gtk2drawing.c in the moz_gtk_init () function totally breaks honors-transparent-bg-hint support for GtkEntry by forcing the setting to FALSE no matter the theme. 

I'm not sure what particular issues setting this to FALSE fixes, but a theme setting the flag means that it supports the behavior. Any problems with it should be reported to the theme engine authors.
Comment 5 Brandon Wright 2009-11-01 19:57:13 PST
(In reply to comment #4)
> Additionally, line 871 of gtk2drawing.c in the moz_gtk_init () function totally
> breaks honors-transparent-bg-hint support for GtkEntry by forcing the setting
> to FALSE no matter the theme. 
My mistake. I've checked this and it shouldn't actually be affecting the value. In fact, it looks like "honors-transparent-bg-hint" isn't being picked up. The other widgets with the transparent-bg-hint flag don't actually read the "honors-transparent-bg-hint" flag, but just push the "transparent-bg-hint" bit.

Fixing this, however, the GtkEntry still won't go transparent. Some parent of the widget or wrapping code is drawing a box around it. I don't remember what version this regressed in, but this WAS working correctly at one time.
Comment 6 Martin Robinson 2010-10-08 19:42:43 PDT
Created attachment 70334 [details]
Patch for this issue
Comment 7 Xan Lopez 2010-10-09 02:41:40 PDT
Comment on attachment 70334 [details]
Patch for this issue

View in context: https://bugs.webkit.org/attachment.cgi?id=70334&action=review

Great!

> WebCore/ChangeLog:15
> +

Indeed, I actually remember they do exactly this.
Comment 8 Martin Robinson 2010-10-09 08:24:20 PDT
Comment on attachment 70334 [details]
Patch for this issue

Clearing flags on attachment: 70334

Committed r69448: <http://trac.webkit.org/changeset/69448>
Comment 9 Martin Robinson 2010-10-09 08:24:24 PDT
All reviewed patches have been landed.  Closing bug.