Bug 1457186 - Dispatch the resolutionchange event when DPI settings change on Mac and Linux. r=mstange draft
authorDão Gottwald <dao@mozilla.com>
Thu, 26 Apr 2018 17:33:51 +0200
changeset 788483 2e204ccc465d88799be5178ef603a9a37f75b738
parent 787860 7f6a582f00bfb5d0acb8d8bf7f8c79ca37c99b65
push id107998
push userdgottwald@mozilla.com
push dateThu, 26 Apr 2018 15:34:21 +0000
reviewersmstange
bugs1457186
milestone61.0a1
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
@@ -3402,16 +3402,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++;
 }