Context menu popups opened near screen edge are displayed on wrong screen in dual monitor setup
Affected version
Arch Linux
Mutter: 40.0+55+gf4f82bcb-1 (built from master branch)
Gnome Shell: 1:40.0+39+gd9e953e93-1 (built from master branch)
Wayland: 1.19.0-1
GTK3: 1:3.24.29-1
GTK4: 1:4.2.0-5
This issue only appears in Wayland (Gnome Wayland session).
Bug summary
I have two screens which I arranged side by side via "Join Displays" in gnome-control-center. When an application with native Wayland backend (e.g. gedit or Firefox started with MOZ_ENABLE_WAYLAND=1) is maximized on the left (primary) screen and I want to open a context menu near the right screen edge, the context menu is displayed on the right (secondary) screen. This doesn't happen in the Xorg session or with Firefox on XWayland.
Initially I reported this for Firefox more than one year ago because I assumed that this was a regression only relevant for Firefox, but Jan Horak noticed recently that this issue also affects gedit.
Steps to reproduce
- Open Gedit (or Firefox with MOZ_ENABLE_WAYLAND=1).
- Maximize it on the left/primary screen.
- Right-click near the right edge of the maximized window (inside the window) to open the context menu.
What happened
The context menu popup is displayed on the right/secondary screen, its left border is at the left edge of the right/secondary screen.
What did you expect to happen
I expect to see the context menu popup on the left/primary screen with its right border at the right edge of the left/primary screen, just as with Xorg/XWayland.
Relevant logs, screenshots, screencasts etc.
Initially reported here as a Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1606010