Closed Dunedan closed 4 years ago
Could you please try the commits I just pushed to the next
branch?
While the code from the next
branch does make 0ad
work, it does confine the mouse now for all windows, not just for 0ad
.
Could you please try the latest version?
On first glance it works as expected, but as soon as I use the keyboard to get out of the window and focus it again afterwards, the mouse doesn't get confined anymore.
I can't reproduce that, probably because we use different window managers.
Could you please try with the latest version in next
, and post the ensuing log (with Debug=1
or higher)?
I managed to track down the problem a bit: To trigger the bug, that the mouse doesn't get re-confined when re-entering the window, I have to Alt + Tab out of the window with the confined mouse and then use a mouse click to focus that window again! When going back with Alt + Tab everything works as expected, but when focusing the window with the confine mouse setting using a mouse click, the mouse doesn't get confined anymore until I focus it using Alt + Tab again.
Here is the debug log from running kcalc
(reproducible with any application) under kwin
using the latest code of the next
branch:
$ LD_PRELOAD=`pwd`/\$LIB/hax11.so kcalc
hax11: Found X connection!
hax11: Intercepting X connection!
hax11: Server connection setup reply: 1
hax11: FocusIn: window=8c00006 mode=0 detail=3
hax11: Grabbing mouse grab
hax11: FocusOut: window=8c00006 mode=1 detail=0 # Alt + Tabbing out of the window
hax11: Releasing mouse grab
hax11: FocusOut: window=8c00006 mode=2 detail=5
hax11: Releasing mouse grab
hax11: FocusIn: window=8c00006 mode=2 detail=0
hax11: Grabbing mouse grab
hax11: FocusOut: window=8c00006 mode=1 detail=0
hax11: Releasing mouse grab
hax11: FocusOut: window=8c00006 mode=2 detail=5
hax11: Releasing mouse grab
hax11: FocusIn: window=8c00006 mode=2 detail=0
hax11: Grabbing mouse grab
hax11: FocusOut: window=8c00006 mode=0 detail=3
hax11: Releasing mouse grab
hax11: FocusIn: window=8c00006 mode=0 detail=3 # Refocusing the window using a mouse click; mouse isn't confined now, even though the window has focus
hax11: Grabbing mouse grab
hax11: FocusOut: window=8c00006 mode=0 detail=3 # Focusing another window, using a mouse click again
hax11: Releasing mouse grab
hax11: FocusIn: window=8c00006 mode=0 detail=3 # Refocusing the window using Alt + Tab; mouse is confined again
hax11: Grabbing mouse grab
hax11: FocusOut: window=8c00006 mode=1 detail=0 # Quitting the application using Alt + F4
hax11: Releasing mouse grab
hax11: FocusIn: window=8c00006 mode=2 detail=0
hax11: Grabbing mouse grab
hax11: FocusOut: window=8c00006 mode=0 detail=3
hax11: Releasing mouse grab
hax11: FocusIn: window=8c00006 mode=0 detail=5
hax11: Grabbing mouse grab
hax11: Exiting work thread.
Okay, I think I figured it out. Could you please try the latest version in next
again?
Works great now. Thanks a lot. :+1:
As you integrated the changes from the next
branch into master
, I'm closing this issue now. Thanks a lot again for fixing this issue.
Thank you for your perseverance in helping debug it :)
I'm trying to use
hax11
to confine the mouse in a windowed instance of0ad
running on Debian/unstable. However as soon as I start0ad
I get the following output and just an empty window where I'd expect 0ad to show up (however at least the mouse is already confined in that empty window):My
hax11
config for 0ad is:Wiithout preloading
hax11
,0ad
works fine.