Closed Bug 1791779 Opened 2 years ago Closed 1 year ago

[Wayland] Resize of hidden maximized toplevel window fails

Categories

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

Firefox 105
Unspecified
Linux
defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: roth.simon, Assigned: stransky, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Steps to reproduce:

Use Firefox on Linux and execute the following javascript from a maximized webpage:
window.open("https://www.mozilla.org/", "testPopup", "popup,width=600,height=400");

Actual results:

A maximized popup is created. If the "Restore Down" Button is clicked, the popup takes it's expected form, respectively size (hence 600x400).

Expected results:

The popup should not be maximized after creation. It should have the provided size, immediately (hence 600x400). This behavior is only reproducible with Firefox on Linux. With Firefox on Windows and several other browsers the behavior is as expected. The behavior is also as expected if the parent window was not maximized.

Summary: When opening a popup in Firefox on Linux (only) it is always maximized if the parent window of the popup was also maximized → When opening a popup in Firefox on Linux (only) it is maximized if the parent window of the popup was also maximized
Component: Untriaged → JavaScript Engine
OS: Unspecified → Linux
Product: Firefox → Core
Component: JavaScript Engine → DOM: Core & HTML
Component: DOM: Core & HTML → Widget: Gtk
Priority: -- → P3

It affects Wayland only, work on X11 as expected.

Summary: When opening a popup in Firefox on Linux (only) it is maximized if the parent window of the popup was also maximized → [Wayland] When opening a popup in Firefox on Linux (only) it is maximized if the parent window of the popup was also maximized

This part is relevant:

[Parent 157044: Main Thread]: D/Widget [7fccab013800]: GetScreenBounds -2,-2 -> 1920 x 2032, unscaled -1,-1 -> 960 x 1016
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::Move to 0 x 0
[Parent 157044: Main Thread]: D/Widget [7fccab013800]:   size state is not normal, bailing
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: GetScreenBounds -2,-2 -> 1920 x 2032, unscaled -1,-1 -> 960 x 1016
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::SetSizeMode 0
[Parent 157044: Main Thread]: D/Widget [7fccab013800]:     set normal
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::Resize 800.000000 841.000000
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::ResizeInt w:1600 h:1682
[Parent 157044: Main Thread]: D/Widget [7fccab013800]:   ConstrainSize: w:1600 h;1682
[Parent 157044: Main Thread]: D/Widget [7fccab013800]:   resized 1 aSize [1600, 1682] mLastSizeRequest [1920, 2032] mBounds [1920, 2032]
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::NativeMoveResize move 0 resize 1 to 0,0 -> 800 x 841
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::SetInputRegion(0, 0)
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::DispatchResized() size [1600, 1682]
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::Show state 1 frame Viewport(-1)@7fccaca8f020
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::SetHasMappedToplevel() state 0
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::NativeShow show
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::ShowWaylandToplevelWindow
[Parent 157044: Main Thread]: D/Widget moz_container_wayland_map [7fccab013800]
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::OnMap
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::ConfigureGdkWindow()
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::ConfigureCompositor()
[Parent 157044: Main Thread]: D/Widget [7fccab013800]:   finished, new GdkWindow 7fccab874cc0 XID 0x0
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: GetScreenBounds -2,-2 -> 1600 x 1682, unscaled -1,-1 -> 800 x 841
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: GetScreenBounds -2,-2 -> 1600 x 1682, unscaled -1,-1 -> 800 x 841
[Parent 157044: Main Thread]: D/Widget moz_container_wayland_map_event [7fccab013800]
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::OnWindowStateEvent for 7fccaa048960 changed 0x85 new_window_state 0x80
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: 	Normal
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: 	Tiled: 0
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::OnWindowStateEvent for 7fccaafe7d90 changed 0x85 new_window_state 0x80
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::SetHasMappedToplevel() state 1
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: 	quick return because IS_MOZ_CONTAINER(aWidget) is true
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: configure event 0,0 -> 667 x 569 scale 2
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: GetScreenBounds -2,-2 -> 1600 x 1682, unscaled -1,-1 -> 800 x 841
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::CheckForRollup() aAlwaysRollup 1
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: GetScreenBounds -2,-2 -> 1600 x 1682, unscaled -1,-1 -> 800 x 841
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: GetScreenBounds -2,-2 -> 1600 x 1682, unscaled -1,-1 -> 800 x 841
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::OnWindowStateEvent for 7fccaa048960 changed 0x80 new_window_state 0x0
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: 	early return because no interesting bits changed
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::OnWindowStateEvent for 7fccaafe7d90 changed 0x80 new_window_state 0x0
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: 	quick return because IS_MOZ_CONTAINER(aWidget) is true
[Parent 157044: Main Thread]: D/Widget moz_container_wayland_size_allocate [7fccab013800] 26,60 -> 615 x 480
[Parent 157044: Main Thread]: D/Widget moz_container_wayland_set_scale_factor_locked [7fccab013800] scale 2
[Parent 157044: Main Thread]: D/Widget moz_container_wayland_move [7fccab013800] 26,60
[Parent 157044: Main Thread]: D/Widget [7fccab013800]: nsWindow::OnSizeAllocate 26,60 -> 615 x 480

so we fail to resize hidden toplevel window.

Summary: [Wayland] When opening a popup in Firefox on Linux (only) it is maximized if the parent window of the popup was also maximized → [Wayland] Resize of hidden toplevel window fails

It's dupe of Bug 1449166. It was removed to "fix" Bug 1623106 but that was later fixed by Bug 1623658 / gitlab.gnome.org/GNOME/gtk/-/issues/2538.
So looks like we still need it, reproducible on gtk3-3.24.34 (Fedora 36).

See Also: → 1449166
Summary: [Wayland] Resize of hidden toplevel window fails → [Wayland] Resize of hidden maximized toplevel window fails
Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Blocks: wayland
No longer blocks: wayland-popup
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/1959d914a1c3
[Wayland] Enable maximized window resize workaround for Wayland too r=emilio
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Flags: qe-verify+

I could not reproduce the issue on Ubuntu 20.04 (Wayland) and Fedora Linux 36, using build 107.0a1(20220921214338), I get the correct sized window.
Reporter I can not reproduce the issue in order to confirm the fix. Are there more details about the build with the issue?
Or can you please confirm issue is fixed on your side on latest Beta 109.0b2 (https://archive.mozilla.org/pub/firefox/candidates/109.0b2-candidates/) and Nightly (https://archive.mozilla.org/pub/firefox/nightly/2022/12/2022-12-14-03-34-16-mozilla-central/). Thank you so much.

Flags: needinfo?(roth.simon)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: