diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp index 19a1440a5fdb..ff293fde9f5a 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp @@ -2436,21 +2436,13 @@ void AppWindow::SizeShell() { specHeight += windowDiff.height; } - bool positionSet = !mIgnoreXULPosition; nsCOMPtr parentWindow(do_QueryReferent(mParentWindow)); -#if defined(XP_UNIX) && !defined(XP_MACOSX) - // don't override WM placement on unix for independent, top-level windows - // (however, we think the benefits of intelligent dependent window placement - // trump that override.) - if (!parentWindow) positionSet = false; -#endif - if (positionSet) { - // We have to do this before sizing the window, because sizing depends - // on the resolution of the screen we're on. But positioning needs to - // know the size so that it can constrain to screen bounds.... as an - // initial guess here, we'll use the specified size (if any). - positionSet = LoadPositionFromXUL(specWidth, specHeight); - } + // We have to do this before sizing the window, because sizing depends + // on the resolution of the screen we're on. But positioning needs to + // know the size so that it can constrain to screen bounds.... as an + // initial guess here, we'll use the specified size (if any). + bool positionSet = + !mIgnoreXULPosition && LoadPositionFromXUL(specWidth, specHeight); if (gotSize) { SetSpecifiedSize(specWidth, specHeight); diff --git a/xpfe/appshell/test/chrome.toml b/xpfe/appshell/test/chrome.toml index 79403a7a4500..62b199ffef52 100644 --- a/xpfe/appshell/test/chrome.toml +++ b/xpfe/appshell/test/chrome.toml @@ -1,3 +1,7 @@ [DEFAULT] +["test_bug2070008_independent_window_position.xhtml"] +skip-if = ["os == 'linux' && display == 'wayland'"] # Wayland compositors place toplevels themselves. +support-files = ["window_bug2070008.xhtml"] + ["test_windowlessBrowser.xhtml"] diff --git a/xpfe/appshell/test/test_bug2070008_independent_window_position.xhtml b/xpfe/appshell/test/test_bug2070008_independent_window_position.xhtml new file mode 100644 index 000000000000..2585cdd1d0f2 --- /dev/null +++ b/xpfe/appshell/test/test_bug2070008_independent_window_position.xhtml @@ -0,0 +1,56 @@ + + + + + + + + + diff --git a/xpfe/appshell/test/window_bug2070008.xhtml b/xpfe/appshell/test/window_bug2070008.xhtml new file mode 100644 index 000000000000..f04bcc269fd6 --- /dev/null +++ b/xpfe/appshell/test/window_bug2070008.xhtml @@ -0,0 +1,9 @@ + + +