sway: Popups in firefox >= 92.0b2 are broken with scale != 1
-
Sway Version:
- sway version 1.6-d0fe721f (Aug 9 2021, branch ‘master’)
- wlroots 88f65db87f8c6cc1f5598ef1b782a7cef6303dd2 (latest master at the moment)
-
Debug Log:
- https://gist.github.com/b5378de60dcf1e60d083927446298ca5
exec firefoxin a sway config, then clicked menu button, then pocket button
-
Description: Since firefox bugs are allowed now, let’s report https://bugzilla.mozilla.org/show_bug.cgi?id=1722767 here. Popups (both menus and right-click) in the current firefox nightly are not visible in sway.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 25
- Comments: 72 (16 by maintainers)
Firefox 93 will fix that for old Gtk versions.
Resolved by https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3941.
Here’s a revived patch w/ Carlos’s NULL buffer approach, since for some reason just cherry-picking it caused conflicts.
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3898
and with this I can no longer reproduce.
Feel free to test. I’m waiting for logs from #6147 folks to understand how this manifests on multi-output setups, cause I’m pretty sure they’re the same.
EDIT: patch -> link
It looks fine to me.
@stransky sway doesn’t respond to the callback because the surface is destroyed.
Here is logging typical of a failed popup on scale != 1:
`MOZ_LOG="WidgetWayland:5 WidgetScreen:5 WidgetPopup:5" WAYLAND_DEBUG=1 firefox --gdk-debug=events
In this case the popup was atually killed before the frame event was even commited (is this a typo? FF immediately commits the subsurface & flushes the display after requesting a callback on the parent). At the time firefox complains about not being able to obtain the container lock, the frame handler that’s supposed to unlock it is waiting for a callback that doesn’t exist.
The frame is requested here: https://searchfox.org/mozilla-central/source/widget/gtk/MozContainerWayland.cpp#527
The surface is destroyed by gtk in
gdk_wayland_window_hide_surfacehere: https://gitlab.gnome.org/GNOME/gtk/-/blob/d4e2d05cd9518ba04d6fbe1cbcec27142788ac95/gdk/wayland/gdkwindow-wayland.c#L3396The enter event triggers it in gtk via
surface_enter -> window_update_scale -> gdk_wayland_window_maybe_configure -> gdk_window_hide: https://gitlab.gnome.org/GNOME/gtk/-/blob/d4e2d05cd9518ba04d6fbe1cbcec27142788ac95/gdk/wayland/gdkwindow-wayland.c#L1227is this related to my issue with bitwarden’s folder selection breaking the parent popup?
demo: https://user-images.githubusercontent.com/82718618/189556171-bc2c2961-76aa-4f65-946a-1724397cc89c.mp4
There’s another scale ‘fix’ for scale & popups which landed in Nightly (FF95): https://bugzilla.mozilla.org/show_bug.cgi?id=1735095
@stransky since gtk!3898 is rejected, I created https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3941 to fix the gdk bug with handling firefox’s duplicate wl_outputs so that it doesn’t loop. That should make it possible in principle to correct this behavior by doing as jadahl suggests.
I’d still like gdk to be capable of handling pre-map enter events correctly, but it will require a different approach.
I have either this issue or one very close on Firefox 91.0 and Sway 1.6.1-1 (Arch Linux).
No scaling on Sway, but in Firefox with
layout.css.devPixelsPerPxset to 1.4 menus from the navigation bar (addons &c.) are invisible but flicker as i move the mouse over them. Setting the property to 1.39 instead leads to stable addon menus, but the bookmarks menu remaining unusable. If i then set the Sway scale to something other than 1, the bookmark menu works, but not the addon menus (the Firefox scale shrinks too for some reason).Firefox Nightly 92.0a1.20210718212857+ha95d4908bc83-1 behaves the same, as does
sway-gitr6607.28cadf55-1 (Arch Linux).Not fixed on freshly-built AUR packages on scale 1.5:
(hidpi is for hidpi xwayland support.)
Symptoms are identical. Returning once again to firefox-nightly-en-gb 92.0a1.20210719.215029-1, probably the last version which works properly.