bug 861112 - (widget/gtk2) scaling from display to device pixels should only apply to top-level windows/dialogs/popups, not to child or plugin windows. r=roc
authorJonathan Kew <jkew@mozilla.com>
Sat, 13 Apr 2013 08:53:47 +0100
changeset 139649 a0e3cd48151b7b323d403f3c5a918104de44e00b
parent 139648 278d87108cb00ac311b2f1972defac0be64ecd33
child 139650 1fd472d11b4c9d72f6917c7773c6af6dfc6dfb63
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs861112
milestone23.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 861112 - (widget/gtk2) scaling from display to device pixels should only apply to top-level windows/dialogs/popups, not to child or plugin windows. r=roc
widget/gtk2/nsWindow.cpp
--- a/widget/gtk2/nsWindow.cpp
+++ b/widget/gtk2/nsWindow.cpp
@@ -990,17 +990,18 @@ nsWindow::Show(bool aState)
     NativeShow(aState);
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::Resize(double aWidth, double aHeight, bool aRepaint)
 {
-    double scale = GetDefaultScale();
+    double scale =
+        mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0;
     int32_t width = NSToIntRound(scale * aWidth);
     int32_t height = NSToIntRound(scale * aHeight);
     ConstrainSize(&width, &height);
 
     // For top-level windows, aWidth and aHeight should possibly be
     // interpreted as frame bounds, but NativeResize treats these as window
     // bounds (Bug 581866).
 
@@ -1070,17 +1071,18 @@ nsWindow::Resize(double aWidth, double a
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::Resize(double aX, double aY, double aWidth, double aHeight,
                  bool aRepaint)
 {
-    double scale = GetDefaultScale();
+    double scale =
+        mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0;
     int32_t width = NSToIntRound(scale * aWidth);
     int32_t height = NSToIntRound(scale * aHeight);
     ConstrainSize(&width, &height);
 
     int32_t x = NSToIntRound(scale * aX);
     int32_t y = NSToIntRound(scale * aY);
     mBounds.x = x;
     mBounds.y = y;
@@ -1158,17 +1160,18 @@ nsWindow::IsEnabled() const
 
 
 NS_IMETHODIMP
 nsWindow::Move(double aX, double aY)
 {
     LOG(("nsWindow::Move [%p] %f %f\n", (void *)this,
          aX, aY));
 
-    double scale = GetDefaultScale();
+    double scale =
+        mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0;
     int32_t x = NSToIntRound(aX * scale);
     int32_t y = NSToIntRound(aY * scale);
 
     if (mWindowType == eWindowType_toplevel ||
         mWindowType == eWindowType_dialog) {
         SetSizeMode(nsSizeMode_Normal);
     }