Closed Bug 581863 Opened 15 years ago Closed 11 months ago

gtk/nsWindow::GetScreenBounds returns client window size instead of outer (frame) size

Categories

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

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: karlt, Assigned: emilio)

References

(Blocks 2 open bugs, Regressed 2 open bugs)

Details

(Keywords: perf-alert, Whiteboard: tpi:-, [wptsync upstream], [webdriver:m15][webdriver:external])

Attachments

(3 files)

nsIWidget::GetScreenBounds should return the "widget's outside dimensions in global coordinates. This includes any title bar on the window." Correcting this will make test_screenPersistence.xul at least correctly notice that windows created with outer dimensions have the wrong size. test_screenPersistance.xul will also fail because it opens a window with (inner, I assume) width/height = 300 and expects outerWidth/outerHeight to be 300.
gdk_window_get_frame_extents is the function to use here.
(In reply to comment #0) > Correcting this will make test_screenPersistence.xul at least correctly notice > that windows created with outer dimensions have the wrong size. Filed Bug 581866.
Assignee: nobody → diogo.gmt
Whiteboard: tpi:-
Closing GTK2 related bugs since we removed GTK2 support at the beginning of 2018 in bug 1278282. Probably best to open a new bug in the unlikely event that any of these are still relevant.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Summary: gtk2/nsWindow::GetScreenBounds returns client window size instead of outer (frame) size → gtk/nsWindow::GetScreenBounds returns client window size instead of outer (frame) size

The bug assignee didn't login in Bugzilla in the last 7 months.
:stransky, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: diogo.gmt → nobody
Flags: needinfo?(stransky)
Blocks: gtktitlebar
Flags: needinfo?(stransky)
Priority: -- → P3
Severity: normal → S3

I stumbled upon this bug while realizing that some of the math I'm doing
for PiP windows doesn't work at all on Linux (bug 1934760), because
screenX != mozInnerScreenX, even though outerWidth == innerWidth.

I've tested this on X11 and Wayland (plasma and Gnome) with CSD and SSD,
and in general, this is the same thing Windows does, so should be fine.

The basic idea is:

  • Keep mBounds being frame manager bounds (so, outer* and screen*),
    relative to mShell.

  • Keep mClientMargin to translate from mBounds to client bounds.

This is both simpler and makes the math consistent.

Assignee: nobody → emilio
Blocks: 1934760

Try a bit harder to set the window size and position.

The change to set_get_window_rect.html is justified as follows:

  • The Window Position test already fails on Linux (actually only on
    Mutter, because of what I think is a bug... We request the right
    move to (150, 175), but the compositor moves us to (150, 137). My
    patch doesn't change that.

  • However the second test (window size) relies on the position test to
    have moved the window to the right place, as it hard-codes the old
    window position. On the second request, Mutter actually does the
    right thing and moves us there. Instead, make sure not to trigger a
    move in the window size test.

  • Use a slightly bigger size on the fractional sizes test, because
    otherwise it hits the minimum window with on wayland (where the outer
    size includes a somewhat large shadow).

  • Also include the minimum screen size as well: The set.py change fails
    locally, but not on automation, without that change, but it is
    correct afaict.

  • Some tests in set.py fail on automation still, but not locally. These are
    very likely mutter issues / bugs: The browser is not really required to
    honor our maximize / size requests as-is... I can't repro these locally at
    all even with virtually the same screen configuration as automation, so I
    suspect these have been fixed upstream already.

  • In ext-windows.js, set the position and size on creation. This moves
    the burden of doing so to widget, and could avoid flickering.

  • In browser_ext_windows_size.js, we cope with the fact that on linux
    the specified size might be the inner rather than outer size. This
    was already the case before, but outer{Width,Height} reported always
    the inner size so it was papered.

  • In browser_unified_extensions_overflowable_toolbar.js and the
    relevant head file, we make the code a bit more reliable. This is all
    to workaround a mutter but on automation, where if a window was
    already maximized and you request a resize, mutter will (correctly)
    restore() the window, but will lose the resize information. This
    doesn't happen on newer Mutter versions. Still, it seems easier to
    use window.maximize(), etc than manually trying to maximize the
    window.

  • In head_unified_extensions.js we also remove the code to ensure
    stable positions since it was broken (it was checking
    win.screen.{top,left}, rather than win.screen{X,Y}). We can always
    bring it back fixed if really needed.

Blocks: 1944687
Attachment #9460583 - Attachment description: Bug 581863 - WebDriver fixes. r=whimboo → Bug 581863 - [remote] Improve window resizing and positioning reliability
Attachment #9460583 - Attachment description: Bug 581863 - [remote] Improve window resizing and positioning reliability → Bug 581863 - [remote] Improve window resizing and positioning reliability. r=whimboo
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/99f2e9d8191d Fix nsWindow coordinates to make sense. r=stransky,win-reviewers,rkraesig,devtools-reviewers,ochameau https://hg.mozilla.org/integration/autoland/rev/fc49e83f5b43 [remote] Improve window resizing and positioning reliability. r=whimboo,webdriver-reviewers https://hg.mozilla.org/integration/autoland/rev/9efb94e53350 Web ext fixes. r=robwu
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50466 for changes under testing/web-platform/tests
Whiteboard: tpi:- → tpi:-, [wptsync upstream]
Pushed by smolnar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fd19a8dadb92 Fix screenshot test resize function when starting maximized.
Regressions: 1945668
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
See Also: → 1945749
Regressions: 1945834
Regressions: 1945818
Regressions: 1946016
Regressions: 1946154
Regressions: 1946167
No longer regressions: 1946167
Regressions: 1946193
Regressions: 1946298
Regressions: 1946676

(In reply to Pulsebot from comment #8)

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/99f2e9d8191d
Fix nsWindow coordinates to make sense.
r=stransky,win-reviewers,rkraesig,devtools-reviewers,ochameau
https://hg.mozilla.org/integration/autoland/rev/fc49e83f5b43
[remote] Improve window resizing and positioning reliability.
r=whimboo,webdriver-reviewers
https://hg.mozilla.org/integration/autoland/rev/9efb94e53350
Web ext fixes. r=robwu

Perfherder has detected a devtools performance change from push 9efb94e533503b0cd1309c16d01d488a69941059.

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
2% damp console.bulklog linux1804-64-shippable-qr e10s fission stylo webrender 821.49 -> 805.02

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run these tests on try with ./mach try perf --alert 43707

For more information on performance sheriffing please see our FAQ.

Keywords: perf-alert
No longer blocks: 1944687
Whiteboard: tpi:-, [wptsync upstream] → tpi:-, [wptsync upstream], [webdriver:m15][webdriver:external]
Regressions: 1947124
Regressions: 1947181
Regressions: 1784720
Regressions: 1947689
Regressions: 1947690
Regressions: 1950911
No longer regressions: 1946108
Regressions: 1951296
Regressions: 1958174
Duplicate of this bug: 581866
Regressions: 1962688
Regressions: 1965143
Regressions: 1967082
Regressions: 1974876
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: