Closed Bug 1760276 Opened 3 years ago Closed 3 years ago

[Wayland] Don't use move-to-rect to place popups in area of main window

Categories

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

defect

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

We use move-to-rect positioning which is kind of broken due to Gtk3 bug https://gitlab.gnome.org/GNOME/gtk/-/issues/1986 (which is fixed in Gtk4).

As a workaround we can:

  • don't use move-to-rect of we know the popup is placed inside Firefox toplevel window
  • don't use move-to-rect for popup resizes
See Also: → 1754950

This may fix Bug 1754950 for some cases.

Priority: -- → P3

Due to move-to-rect limitations (https://gitlab.gnome.org/GNOME/gtk/-/issues/1986) we try to avoid it when it's possible.

  • Use plain popup resize/movement when popup is places inside of application toplevel window.
  • Hide moved/scaled popup window only when move-to-rect is used.
  • Clear mMoveToRectPopupRect before any move/resize and use Wayland compositor to place/size the window.

Depends on D141600

Use mMoveToRectPopupRect popup constrains in nsMenuPopupFrame::SetPopupPosition only and make it pernament.
In such setup works as screen size constraints.

Don't call SetPopupPosition from move-to-rect callback and let layout code to handle that.

Remove MoveToRectPopupRectClear() as it's not needed, we keep mMoveToRectPopupRect
in nsMenuPopupFrame as well as we keep screen sizes there.

Depends on D141601

Depends on: 1760184
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/e8e0571ab13b [Wayland] When we check for popup resize workaround, consider toplevel window instead of parent one, r=emilio https://hg.mozilla.org/integration/autoland/rev/3d351d90db7b [Wayland] Avoid to use move-to-rect when possible r=emilio https://hg.mozilla.org/integration/autoland/rev/e98dce4c58db [Wayland] Fix loop in popup move-to-rect resizes r=emilio

Backed out for causing multiple build bustages on nsMenuPopupFrame.cpp and nsWindow.cpp

Backout link

Push with failures

Failure log 1 // Failure log 2

Failure line: /builds/worker/checkouts/gecko/layout/xul/nsMenuPopupFrame.cpp:1574:9: error: expected expression

Failure line 2: /builds/worker/checkouts/gecko/widget/gtk/nsWindow.cpp:2041:14: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]

Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/d62295e8fa9b [Wayland] When we check for popup resize workaround, consider toplevel window instead of parent one, r=emilio https://hg.mozilla.org/integration/autoland/rev/7757dfa7f893 [Wayland] Avoid to use move-to-rect when possible r=emilio https://hg.mozilla.org/integration/autoland/rev/8a83aa3ec309 [Wayland] Fix loop in popup move-to-rect resizes r=emilio
Regressions: 1761895
Regressions: 1762152
Regressions: 1762365
Blocks: 1754950
See Also: 1754950
Regressions: 1764319
Regressions: 1769323
Regressions: 1777186
Regressions: 1777269
Regressions: 1784873
No longer regressions: 1784873
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: