franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
767 stars 70 forks source link

Detect focused window correctly under GNOME Shell + Wayland #83

Closed liblit closed 4 years ago

liblit commented 4 years ago

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 as 0x0 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.

franciscolourenco commented 4 years ago

@liblit thank you for the contribution. Could you test if this is indeed also working with Gnome on x11? thanks!

liblit commented 4 years ago

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.

franciscolourenco commented 4 years ago

Thank you for the contribution!