Bug 1414272 - Implement SetNonClientMargins() for Gtk+, r=jhorak
authorMartin Stransky <stransky@redhat.com>
Fri, 03 Nov 2017 15:38:29 +0100
changeset 443762 b7736e7e1d4fd6b650650959206f8db6d8997089
parent 443761 08db22c1312e59004f6509858f7308cd9ca7a748
child 443763 0f669b70d35963ed8e2f7e22beef23b84770fc65
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak
bugs1414272
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1414272 - Implement SetNonClientMargins() for Gtk+, r=jhorak Original patch author is Andrew Comminos [:acomminos] <andrew@comminos.com> MozReview-Commit-ID: Jnqz35iNsQb
widget/gtk/nsWindow.cpp
widget/gtk/nsWindow.h
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -6615,16 +6615,23 @@ nsWindow::ClearCachedResources()
     for (GList* list = children; list; list = list->next) {
         nsWindow* window = get_window_for_gdk_window(GDK_WINDOW(list->data));
         if (window) {
             window->ClearCachedResources();
         }
     }
 }
 
+nsresult
+nsWindow::SetNonClientMargins(LayoutDeviceIntMargin &aMargins)
+{
+  SetDrawsInTitlebar(aMargins.top == 0);
+  return NS_OK;
+}
+
 void
 nsWindow::SetDrawsInTitlebar(bool aState)
 {
   if (!mIsCSDAvailable || aState == mIsCSDEnabled)
       return;
 
   if (mShell) {
       gint wmd = aState ? GDK_DECOR_BORDER : ConvertBorderStyles(mBorderStyle);
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -346,16 +346,17 @@ public:
                                                 nsIObserver* aObserver) override;
 #endif
 
 #ifdef MOZ_X11
     Display* XDisplay() { return mXDisplay; }
 #endif
     virtual void GetCompositorWidgetInitData(mozilla::widget::CompositorWidgetInitData* aInitData) override;
 
+    virtual nsresult SetNonClientMargins(LayoutDeviceIntMargin& aMargins) override;
     void SetDrawsInTitlebar(bool aState) override;
 
     // HiDPI scale conversion
     gint GdkScaleFactor();
 
     // To GDK
     gint DevicePixelsToGdkCoordRoundUp(int pixels);
     gint DevicePixelsToGdkCoordRoundDown(int pixels);