Bug 1237823 - Change to screen.js in order to prevent endless loop when window maximized. r=fabrice
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Tue, 02 Feb 2016 17:52:00 -0500
changeset 325583 90ead10ecd0e
parent 325582 c33f85a4b6a4
child 325584 58e8a2602d03
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs1237823
milestone47.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 1237823 - Change to screen.js in order to prevent endless loop when window maximized. r=fabrice
b2g/chrome/content/screen.js
--- a/b2g/chrome/content/screen.js
+++ b/b2g/chrome/content/screen.js
@@ -99,16 +99,17 @@ function onStart() {
   
   // Special case --screen=full goes into fullscreen mode
   if (screenarg === 'full') {
     shell.setAttribute('sizemode', 'fullscreen');
     return;
   } 
 
   let width, height, ratio = 1.0;
+  let lastResizedWidth;
 
   if (screenarg in screens) {
     // If this is a named screen, get its data
     let screen = screens[screenarg];
     width = screen.width;
     height = screen.height;
     ratio = screen.ratio;
   } else {
@@ -149,16 +150,22 @@ function onStart() {
     if (isMulet) {
       let tab = browserWindow.gBrowser.selectedTab;
       let responsive = ResponsiveUIManager.getResponsiveUIForTab(tab);
       responsive.setSize(width + 16*2,
                          height + controlsHeight + 61);
     } else {
       let chromewidth = window.outerWidth - window.innerWidth;
       let chromeheight = window.outerHeight - window.innerHeight + controlsHeight;
+
+      if (lastResizedWidth == width) {
+        return;
+      }
+      lastResizedWidth = width;
+
       window.resizeTo(width + chromewidth,
                       height + chromeheight);
     }
 
     let frameWidth = width, frameHeight = height;
 
     // If the current app doesn't supports the current screen orientation
     // still resize the window, but rotate its frame so that