Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland Support - A blessing and a curse #18

Open
ErikBjare opened this issue Jun 22, 2017 · 17 comments
Open

Wayland Support - A blessing and a curse #18

ErikBjare opened this issue Jun 22, 2017 · 17 comments

Comments

@ErikBjare
Copy link
Member

ErikBjare commented Jun 22, 2017

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.

@SanketDG
Copy link

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"

@ErikBjare
Copy link
Member Author

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.

@SanketDG
Copy link

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

@ErikBjare
Copy link
Member Author

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:

@SanketDG
Copy link

SanketDG commented Nov 11, 2017

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?

@ErikBjare
Copy link
Member Author

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

@Ramblurr
Copy link

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.

@ErikBjare
Copy link
Member Author

ErikBjare commented Apr 3, 2018

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.

@abijr
Copy link

abijr commented Sep 17, 2018

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.

@johan-bjareholt
Copy link
Member

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.

@glyph
Copy link

glyph commented Sep 21, 2018

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.

@johan-bjareholt
Copy link
Member

@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
Copy link
Member

johan-bjareholt commented Dec 7, 2018

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

flatpak/xdg-desktop-portal#42 (comment)

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

@glyph
Copy link

glyph commented Dec 8, 2018

Thanks for mentioning this progress! Looking forward to it.

@glyph
Copy link

glyph commented Sep 24, 2019

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

@johan-bjareholt
Copy link
Member

@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 ActivityWatch/activitywatch#92

@glyph
Copy link

glyph commented Sep 24, 2019

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants