Bug 1423869 - don't draw to mContainer when decorations are rendered by window manager, r?jhorak draft
authorMartin Stransky <stransky@redhat.com>
Mon, 11 Dec 2017 11:07:48 +0100
changeset 710638 71d3d83c61cac2bc4cc84935418c98155598e868
parent 710637 d6032db413a10d8ce0d505d723d2879896b1cbd1
child 743621 ff55bdc82c51c0645593d48150145cd3634d812d
push id92867
push userstransky@redhat.com
push dateMon, 11 Dec 2017 10:08:51 +0000
reviewersjhorak
bugs1423869, 1421974
milestone59.0a1
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
widget/gtk/nsWindow.cpp
--- 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);