aw-watcher-window icon indicating copy to clipboard operation
aw-watcher-window copied to clipboard

Wayland Support - A blessing and a curse

Open ErikBjare opened this issue 7 years ago • 17 comments

Wayland will complicate matters, we will now have to support whatever each compositor uses.

Ubuntu will use Wayland from 17.10 (Update: But will switch back to Xorg in 18.04) so that would potentially put a lot of users outside of our abilities to collect windows.

Gnome support might be doable, we'll have to check out how you get the active window there. I don't use Gnome and probably wont fix support anytime soon, but it needs done sooner or later.

ErikBjare avatar Jun 22 '17 18:06 ErikBjare

Hi,

I use gnome with wayland, and exept things like google-chrome, vlc nothing else seems to get logged. They are simply marked with "unknown"

SanketDG avatar Nov 10 '17 12:11 SanketDG

Yeah, sorry about that. You'll have to switch to Gnome with X11 if you want to log the active window.

Unfortunately, I can't do much about it. There is simply no way in Wayland to grab the current window (due to valid security concerns), so we can't watch it.

ErikBjare avatar Nov 10 '17 17:11 ErikBjare

Okay, I could switch back to X11. But most distros are switching to Wayland, right? How are you planning to go around this?

SanketDG avatar Nov 11 '17 14:11 SanketDG

Yes, most distros using Gnome are switching to Wayland it would seem. We're trying to find a solution, but we can't do it without the help of desktop environment developers. I've, among other things, made a note of it in the Gnome bugtracker.

It will probably take a while, but you can keep an eye on:

ErikBjare avatar Nov 11 '17 15:11 ErikBjare

I see how the WSM could be immensely helpful to this, hopefully it happens y sooner!

In the meantime, what do you think about adding a note about this somewhere in the docs?

SanketDG avatar Nov 11 '17 17:11 SanketDG

I'll add a note of it in the FAQ, it might take a while to update: https://activitywatch.readthedocs.io/en/latest/faq.html

ErikBjare avatar Nov 11 '17 19:11 ErikBjare

Found activity watch, and was interested in using it. But I'm Fedora where wayland is the default.

So I'll be watching this issue for updates. Good luck :\ seems like this might be a very difficult nut to crack.

Ramblurr avatar Dec 17 '17 10:12 Ramblurr

Looks like Ubuntu will be switching back to Xorg as the default in the upcoming 18.04 LTS, so the problem might not be quite as urgent.

ErikBjare avatar Apr 03 '18 09:04 ErikBjare

So, what's the status on this? What are the current problems?

If I run xprop.py under wayland I get most of the window classes.

Also, a Gnome 3 plugin might do the trick, I'm able to get all window classes I've tried.

abijr avatar Sep 17 '18 01:09 abijr

If I run xprop.py under wayland I get most of the window classes.

You will get info from all windows running under Xwayland, but nothing else.

Also, a Gnome 3 plugin might do the trick, I'm able to get all window classes I've tried.

Of course you could write a Gnome plugin, but there are tens of window managers for Linux and we cannot support all of them so in my opinion it's a waste of time to write WM-specific watchers.

What would be needed to get Wayland support would be to propose a protocol exposing window info to https://github.com/wayland-project/wayland-protocols and then getting window managers to support this protocol. This would probably take years, but that is the only viable option as far as I know.

johan-bjareholt avatar Sep 17 '18 07:09 johan-bjareholt

Of course you could write a Gnome plugin, but there are tens of window managers for Linux and we cannot support all of them so in my opinion it's a waste of time to write WM-specific watchers.

This is a drive-by comment and I'm not going to do any of the work here - I'm just interested in the issue in general.

While in principle users could use anything, wouldn't a GNOME and a KDE interface cover a substantial plurality of interested users, while giving the weirdos[1] who use Grefsen or Waymonad or whatever a clear place in the implementation to plug in their own version, where now none exists?


[1]: This term is used with only the greatest affection and respect.

glyph avatar Sep 21 '18 05:09 glyph

@glyph True, but the time spent on making even just two watchers is probably better spent to make a single unified watcher IMO. Also there's lots of more WMs which are not that rare such as XFCE, LXQt, MATE, Cinnamon, Pantheon, Budgie etc. so it's just going to be an endless flow of requests if ActivityWatch becomes more popular (which I hope it will in the long run).

My opinion might also be a bit biased since I'm using odd WMs myself though haha

johan-bjareholt avatar Sep 21 '18 06:09 johan-bjareholt

Good news, Flatpak seems to have found a usecase where they also need to be aware of which window is currently focused! Currently only a gnome-shell branch, but if this development continues it might be possible that this gnome-shell change becomes a part of a freedesktop DBus API, so in that case we might be able to actually implement this with support for every wayland compositor which decides to implement it!

I actually just found this by chance

https://github.com/flatpak/xdg-desktop-portal/issues/42#issuecomment-418671789

EDIT: This comment is relevant aswell https://gitlab.gnome.org/jadahl/gnome-shell/commit/a31e33d5813dfe7c77c1a3a58c9f107d5242b1cb#note_339241

johan-bjareholt avatar Dec 07 '18 09:12 johan-bjareholt

Thanks for mentioning this progress! Looking forward to it.

glyph avatar Dec 08 '18 01:12 glyph

@johan-bjareholt So… it's been almost a year. Did anything ever come of that? :)

glyph avatar Sep 24 '19 00:09 glyph

@glyph There has definitely been progress, there's a duplicate issue of this one where I have explained what I've been working on with wayland support https://github.com/ActivityWatch/activitywatch/issues/92

johan-bjareholt avatar Sep 24 '19 06:09 johan-bjareholt

@johan-bjareholt thanks so much for the update. Glad there's progress in this area! I wrote some code back in the day with wnck and it would be nice to have a modern, more secure replacement :)

glyph avatar Sep 24 '19 17:09 glyph