From 0ac9150f7e72a5dae5ee963ff65c8802323509af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 1 Mar 2025 22:48:22 +0000 Subject: [PATCH] Bug 1947453 - Remove retry logic from geometryMatches. r=whimboo,webdriver-reviewers It seems to confuse macOS, doesn't seem needed anymore on Linux after bug 1946184, where we started to look at the X server position rather than the last configure position. Differential Revision: https://phabricator.services.mozilla.com/D240067 --- remote/shared/WindowManager.sys.mjs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/remote/shared/WindowManager.sys.mjs b/remote/shared/WindowManager.sys.mjs index af1da9d25b45..5627251d9534 100644 --- a/remote/shared/WindowManager.sys.mjs +++ b/remote/shared/WindowManager.sys.mjs @@ -202,10 +202,7 @@ class WindowManager { // incorrectly reset the position without this check. let foundMatch = false; - // We retry on each iteration because on Linux, when combined with some - // sizemode changes (e.g. unmaximizing), the size request might get lost - // and we might get resized to the restored size / position. - function geometryMatches(retry = false) { + function geometryMatches() { lazy.logger.trace( `Checking window geometry ${win.outerWidth}x${win.outerHeight} @ (${win.screenX}, ${win.screenY})` ); @@ -221,9 +218,6 @@ class WindowManager { (win.outerWidth !== width || win.outerHeight !== height) ) { sizeMatches = false; - if (retry) { - win.resizeTo(width, height); - } } // Wayland doesn't support getting the window position. if ( @@ -233,9 +227,6 @@ class WindowManager { (win.screenX !== x || win.screenY !== y) ) { posMatches = false; - if (retry) { - win.moveTo(x, y); - } } if (sizeMatches && posMatches) { lazy.logger.trace(`Requested window geometry matches`); @@ -250,9 +241,7 @@ class WindowManager { // to previous geometry changes, such as from restoreWindow(), so // wait longer if window geometry does not match. const options = { - checkFn() { - return geometryMatches(/* retry = */ true); - }, + checkFn: geometryMatches, timeout: 500, }; const promises = [];