logoalt Hacker News

AyanamiKainetoday at 11:17 AM5 repliesview on HN

Slightly related. On wayland based linux desktops this would never work because an app is not allowed to hijack the mouse pointer to dispatch events. I believe only the compositor is allowed to do that.

I know, because I wanted to automate a GUI task using PyAutoGUI and it wouldnt work on wayland no matter what.


Replies

KetoManx64today at 11:49 AM

This is why I'm still on X11, the lack of deep level accessibility/automation is still a big hurdle when it comes to Wayland.

show 1 reply
binarintoday at 12:04 PM

Actual problem on Wayland is that it often doesn't work when you are trying to click somewhere in the menu - for the mouse clicking app to read keyboard input, it must take focus away from the app where the click should go. And some toolkits just close menus on focus loss.

I personally use wl-kbptr, and the problem above is the only one that can't be solved without explicit support from the compositor.

gen2braintoday at 12:49 PM

What about wp_pointer_warp_v1? That should be supported in some compositors. But not sure how to actually "send" the click event.

I often try a session with Labwc/LxQt instead of my Openbox/LxQt, and while there is progress, still not fully usable, so still no Wayland for me. But with X11, I can at least add xvfb, xdotool, and other utils, and AI has no problem writing (and testing) a GUI for me.

show 1 reply
Fire-Dragon-DoLtoday at 11:30 AM

There is mouseless that seems to work on wayland

https://mouseless.click/

show 2 replies
AlienRobottoday at 11:27 AM

I wonder if blender works on wayland, because it has a feature that makes the mouse cursor "loop" across the window if you are dragging something.

show 2 replies