Bug 1423869 - don't draw to mContainer when decorations are rendered by window manager, r?jhorak
Bug 1421974 introduced new mechanism to hide system titlebar by enabling client-side decorations for main Firefox window. It also causes a regression when the CSD window setup is enabled when system titlebar is hidden by window manager.
This patch fixes that and enables the CSD window setup only for case when it's actualy used.
MozReview-Commit-ID: AqfHR2bGr3K
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3790,18 +3790,19 @@ nsWindow::Create(nsIWidget* aParent,
* 1) We're running on Gtk+ without client side decorations.
* Content is rendered to mShell window and we listen
* to the Gtk+ events on mShell
* 2) We're running on Gtk+ and client side decorations
* are drawn by Gtk+ to mShell. Content is rendered to mContainer
* and we listen to the Gtk+ events on mContainer.
*/
GtkStyleContext* style = gtk_widget_get_style_context(mShell);
- drawToContainer = mIsCSDAvailable ||
- gtk_style_context_has_class(style, "csd");
+ drawToContainer =
+ (mIsCSDAvailable && GetCSDSupportLevel() == CSD_SUPPORT_FLAT ) ||
+ gtk_style_context_has_class(style, "csd");
#endif
eventWidget = (drawToContainer) ? container : mShell;
gtk_widget_add_events(eventWidget, kEvents);
// Prevent GtkWindow from painting a background to avoid flickering.
gtk_widget_set_app_paintable(eventWidget, TRUE);