-
Notifications
You must be signed in to change notification settings - Fork 112
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
Adding Wayland Support #108
Comments
I could be wrong, but I feel like it’s too expensive to be polling the Gnome Shell ALL the time. I want an alternative, a signal that can be registered & listened to.. that way we can wait on refreshing the Window title until we know a change as occurred.
I’m not sure that it’d improve any using dbus libraries in python - if they could even run while running undo sudo.
https://feaneron.com/2019/01/31/gnome-shell-and-mutter-better-faster-cleaner/ GJS calls may be OK as long as you only run them when actual Window focus changes occur & not on every key press. Even now I think an optimization could occur on the x11 side as well. |
Yes, you can request that X inform you about window changes and then we could be notified of them rather than having to query on every keypress. I'm not 100% sure this works with all window managers though. I saw different ways of implementing this functionality, it would need testing. If possible it'd definitely be a nice improvement for the X11 support though. The notes I have on this: |
Updated 10/28/20
I have updated the wayland branch on my fork and it is really still just a proof of concept, I know there are better and fuller ways to make it all pythonic and less likely to break, but this was just to see if it works and it does.
The things I don't like when it comes to implementing it better is that dbus calls from a xkeysnail service or process running under sudo is difficult to do without calling the specific dbus session for the user - so I am at a bit of a loss on how to write it dynamically. I would also prefer to listen and not poll for the changes however often.
I also had to increase the delay to 40 microseconds because 10 did not always solve the sync issues.
rbreaves@2a8dd0e
Any help or suggestions from others would be appreciated. If someone just wants to write a more solid solution based on this work then go for it lol!
Update
Workaround: Add a delay of 10 microseconds on output.py fixes my problem. Now I can work on the rest of it tomorrow. Not sure why wayland messes with the timing of things because even when I monitor it it is not immediately apparent at all.
So I was doing some preliminary work to get Wayland support added for Gnome3 specifically but I am running into an interesting problem that I hope the collaborators here can help me with. @Lenbok @mooz
I know of a way to get the wm class name from the active program in Gnome3 with Wayland and have figured that out since last January actually, so adding Wayland support has always been something I figured I could work on eventually, if no one else were to add it.
Here's the rub though, it appears like the evdev library in xkeysnail is not properly removing or releasing modifier keys under Wayland? It reports that it is when I print it, but that is not how it behaves under Wayland. If I run the exact same code under x11 (without the real xlib based function running) it releases the key as expected, so I know it isn't from me creating a fake "get_active_window_wm_class" function.
My plan is to replace or update the "get_active_window_wm_class" function with a GDBus call that grabs the wm class name of the active window, but until I figure out what is hanging me up I am stuck.
What I plan to convert into python using a GDBus interface/call of some kind.
https://gist.github.com/rbreaves/257c3edfa301786e66e964d7ac036269
The output of where I am stuck.
The test branch
https://github.com/rbreaves/xkeysnail/tree/wayland
sudo pip3 install --upgrade .
The text was updated successfully, but these errors were encountered: