Closed liblit closed 4 years ago
@liblit thank you for the contribution. Could you test if this is indeed also working with Gnome on x11? thanks!
Could you test if this is indeed also working with Gnome on x11?
Tested. It works correctly when GNOME is running under Xorg (X11) instead of Wayland.
Thank you for the contribution!
The
xprop
strategy for checking window focus presumably works correctly when GNOME Shell is using X11. However, when GNOME Shell is using Wayland, the focused window is always reported as0x0
regardless of what actually has focus.My understanding is that Wayland in general does not have a "current focused window" concept at all. Any specific Wayland-based compositor might have such a concept, though. GNOME Shell does have such a concept, and exposes an API for checking the current window focus via JavaScript. We can use the session D-Bus to pass JavaScript to GNOME Shell for evaluation. This should work the same regardless of whether GNOME Shell is using Wayland or X11.