Open Bug 1803611 Opened 1 year ago Updated 6 months ago

Linux handling of window size properties.

Categories

(Core :: Widget: Gtk, defect, P3)

defect

Tracking

()

People

(Reporter: matc.pub, Unassigned)

References

Details

(Keywords: leave-open)

Attachments

(3 files, 3 obsolete files)

Steps to reproduce:

On Linux changing window width and height with individual property changes leads to the first change being ignored.

window.outerWidth = x;
window.outerHeight = y;

Because Linux performs resizes asynchronously this effectively translates to:

let oldX = window.outerWidth;
let oldY = window.outerHeight;
window.resizeTo(x, oldY);
// outerWidth still unchanged
window.resizeTo(oldX, y);

The current approach for tests to work around this (e.g to get a specific inner size) is to brute force the change (e.g. in waitForCondition). This essentially spams the two resizes, with the second one overwriting the first one, until the size is updated with the result of one of the resizes. At this point only the change of the remaining dimension keeps being requested.

With the changes for Bug 1786048, we no longer assume that current sizes are up-to-date, and will continue to request a change for both dimensions. This reduces the chance of eventually settling at the proper size because one request still contains an old dimension.

Changing one dimension and waiting for the resize event, before changing the other dimension is a workaround for this problem.

Note: The resize event on Linux used to be a bad indicator for whether a resize was really complete. This made the brute force approach the only reliable option. But this has been fixed for some time now.

Actual results:

window.outerWidth = x;
window.outerHeight = y;

Changes only the height.

Expected results:

window.outerWidth = x;
window.outerHeight = y;

Should change width and height.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Priority: -- → P3
Assignee: nobody → matc.pub
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Depends on D166877

On Linux changing the window size in two steps (e.g changing outerWidth,
followed by outerHeight), will perform the second step before the first
step completes. The second step supersedes changes made by the first
step.

This patch will use the recently requested dimensions for up to 200ms
as long as the window remains in normal sizemode.

This has a tendency to use the last requested dimensions in cases where
the current dimensions should be used. E.g. after the window manager
ignores a request. But we can assume that repeating such a request will
produce the same result.

nsGlobalWindowOuter enables dimension caching in AppWindow before
performing a dimension change and immediately schedules a task to
disable the cache again.

Depends on D167959

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ec42a7a5186b
Part 1: Use shared code for AppWindow::SetPosition/And/Size. r=emilio
https://hg.mozilla.org/integration/autoland/rev/ea359e7a5514
Part 2: Implement AppWindow::Set/GetDimensions. r=emilio

On X11 mozInnerScreenX/Y are ignored for the first test that runs in a
new popup. For Wayland positions during resize tests are ignored, and
browser_popup_linux_move.js is just a todo checking whether we can
move a window at all.

Also allows to run the tests with resizeTo and moveTo when size and
position property setters are disabled.

Attachment #9312361 - Attachment is obsolete: true
Attachment #9314303 - Attachment is obsolete: true
Attachment #9314304 - Attachment is obsolete: true
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/efe2446e5376
Popup resize and move tests for Linux. r=emilio

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: matc.pub → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: