Bug 1457186 - Dispatch the resolutionchange event when DPI settings change on Mac and Linux. r=mstange
authorDão Gottwald <dao@mozilla.com>
Thu, 26 Apr 2018 17:33:51 +0200
changeset 471975 5cb3b369f134c8dd1f46498fb12f58b92245fd5b
parent 471974 a64ffd8dd1320a175bceb1359886e93d273051eb
child 471976 1e5514bef692f08ee0bce003f6f1c2c256cf808c
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1457186
milestone61.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 1457186 - Dispatch the resolutionchange event when DPI settings change on Mac and Linux. r=mstange MozReview-Commit-ID: DEttWFKyA4
widget/cocoa/nsCocoaWindow.mm
widget/gtk/nsWindow.cpp
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -1826,16 +1826,17 @@ nsCocoaWindow::BackingScaleFactorChanged
   if (!mWidgetListener || mWidgetListener->GetXULWindow()) {
     return;
   }
 
   nsIPresShell* presShell = mWidgetListener->GetPresShell();
   if (presShell) {
     presShell->BackingScaleFactorChanged();
   }
+  mWidgetListener->UIResolutionChanged();
 }
 
 int32_t
 nsCocoaWindow::RoundsWidgetCoordinatesTo()
 {
   if (BackingScaleFactor() == 2.0) {
     return 2;
   }
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3429,16 +3429,17 @@ nsWindow::OnDPIChanged()
 {
   if (mWidgetListener) {
     nsIPresShell* presShell = mWidgetListener->GetPresShell();
     if (presShell) {
       presShell->BackingScaleFactorChanged();
       // Update menu's font size etc
       presShell->ThemeChanged();
     }
+    mWidgetListener->UIResolutionChanged();
   }
 }
 
 void
 nsWindow::OnCheckResize()
 {
     mPendingConfigures++;
 }