Closed Bug 1789581 Opened 2 years ago Closed 2 years ago

[Wayland] Library menu flickering

Categories

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

defect

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #1784876 +++

Library menu is flickering on close. The bug is still here but it's caused by a different cause.

Summary: [Wayland] Library menu flickering on close → [Wayland] Library menu flickering

If there's a gap between popups we can't use move-to-rect as anchor needs to be placed inside of parent popup.
In such case place anchor to upper corner of parent popup and submit popup position as offset.

If popup is moved we can't use recent popup position (mBounds) to check popup placement but
use requested position given at nsWindow::NativeMoveResize().

Depends on D156820

When widget is hidden gtk_window_move() does not move the widget but sets new widget coordinates
when widget is mapped again.

If popup used move-to-rect before (GdkWindow has POSITION_METHOD_MOVE_TO_RECT set),
popup will use move-to-rect again when it's mapped and we'll get bogus move-to-rect callback.

In this patch we implement nsWindow::WaylandPopupMovePlain() to perform simple popup movement.
It calls gdk_window_move() to set position_method to POSITION_METHOD_MOVE_RESIZE when popup is hidden
so we'll use simple move when popup is shown and don't slip to move-to-rect.

Depends on D156821

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/37b28252e060
[Wayland] Use move-to-rect offset to shift popup position when there's a gap between popups r=emilio
https://hg.mozilla.org/integration/autoland/rev/b6e830c59764
[Wayland] Use new popup position at WaylandPopupFitsToplevelWindow() if popup is moved r=emilio
https://hg.mozilla.org/integration/autoland/rev/6d31b0c7cf57
[Wayland] Call gdk_window_move() to reset GdkWindow internal position method r=emilio

I downloaded the build from autoland to check this out. The situation with widget.wayland.use-move-to-rect true is much improved but I am still having issues with nested menus. I have a screencast showing issues with my normal profile but don't like sharing images of my profile. I can share the video one-on-one if you like or you can also reproduce by showing the bookmark toolbar, then attempting to create a set of nested folders there:

  1. right click bookmark toolbar and choose add folder (l1)
  2. click l1 folder in bookmark toolbar then right click Empty folder and choose add folder (l2)
  3. click l1 folder in bookmark toolbar then hover over the l2 folder and attempt and fail to right click the Empty folder.

I am also crashing with MOZ_DIAGNOSTIC_ASSERT(gtk_window_get_type_hint(((((GtkWindow*) g_type_check_instance_cast ((GTypeInstance*) ((mShell)), ((gtk_window_get_type ()))))))) == GDK_WINDOW_TYPE_HINT_UTILITY) . The stacks are pretty useless without symbols on the autoland build though.

Flags: needinfo?(stransky)
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch

(In reply to Bob Clary [:bc] (inactive) from comment #7)

I downloaded the build from autoland to check this out. The situation with widget.wayland.use-move-to-rect true is much improved but I am still having issues with nested menus. I have a screencast showing issues with my normal profile but don't like sharing images of my profile. I can share the video one-on-one if you like or you can also reproduce by showing the bookmark toolbar, then attempting to create a set of nested folders there:

  1. right click bookmark toolbar and choose add folder (l1)
  2. click l1 folder in bookmark toolbar then right click Empty folder and choose add folder (l2)
  3. click l1 folder in bookmark toolbar then hover over the l2 folder and attempt and fail to right click the Empty folder.

I am also crashing with MOZ_DIAGNOSTIC_ASSERT(gtk_window_get_type_hint(((((GtkWindow*) g_type_check_instance_cast ((GTypeInstance*) ((mShell)), ((gtk_window_get_type ()))))))) == GDK_WINDOW_TYPE_HINT_UTILITY) . The stacks are pretty useless without symbols on the autoland build though.

Please create a new bug for that and cc me there.
Thanks.

Regressions: 1791469
Regressions: 1791492
Attachment #9295553 - Attachment is obsolete: true
Flags: needinfo?(stransky)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: