Closed Bug 1189028 Opened 9 years ago Closed 9 years ago

Popup background is garbage on fallback GTK3 theme Raleigh

Categories

(Core :: Widget: Gtk, defect)

Unspecified
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox42 --- fixed
firefox43 --- fixed

People

(Reporter: acomminos, Assigned: acomminos)

References

Details

Attachments

(1 file)

The widget background for popups doesn't appear to be drawn when the GTK3 theme is Raleigh (garbage is displayed).
This appears to be caused by the fact that if a popup menu's background is not specified, the toplevel popup backing the GtkMenu (_GtkMenuPrivate->toplevel) will end up showing a background for the menu. We should consider rendering a popup window behind the menu, like GTK does.
This patch draws our generic popup toplevel behind popup menus. Thanks!
Attachment #8644578 - Flags: review?(karlt)
Comment on attachment 8644578 [details] [diff] [review]
Draw a toplevel popup behind popup menus on GTK3.

(In reply to Andrew Comminos [:acomminos] from comment #1)
> This appears to be caused by the fact that if a popup menu's background is
> not specified, the toplevel popup backing the GtkMenu
> (_GtkMenuPrivate->toplevel) will end up showing a background for the menu.
> We should consider rendering a popup window behind the menu, like GTK does.

>+    // Draw a backing toplevel. This fixes themes that don't provide a menu
>+    // background, and depend on the GtkMenu's implementation window to provide it.
>+    moz_gtk_window_paint(cr, rect, direction);

GtkMenu has its own child window, so I thought it shouldn't be possible to see any drawing on the (_GtkMenuPrivate->toplevel).  But maybe GDK client side child
windows can be translucent.

I wonder whether the background color comes from the 
gtk_style_context_set_background() which sets the GdkWindow background.
However, that would mean that the style context has a background that
gtk_render_background is not drawing, which seems unlikely.

Anyway, this seems to get the right results.
Attachment #8644578 - Flags: review?(karlt) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/12a12a5ca224
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment on attachment 8644578 [details] [diff] [review]
Draw a toplevel popup behind popup menus on GTK3.

Approval Request Comment
[Feature/regressing bug #]: GTK3 
[User impact if declined]: We are shipping GTK3 with 42.  This is one of the blocker bugs for that.
[Describe test coverage new/current, TreeHerder]:
[Risks and why]: 
[String/UUID change made/needed]:
Attachment #8644578 - Flags: approval-mozilla-aurora?
Comment on attachment 8644578 [details] [diff] [review]
Draw a toplevel popup behind popup menus on GTK3.

If there is a chance to ship gtk3 in 42, let's take it.
Attachment #8644578 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: