Quake3e
Quake3e copied to clipboard
wayland: cursor stucks on screen
OS: Alpine Linux Wayland compositor: sway 1.5.1 Graphics card: AMD RX590 Quake3e version: master db258d4901b15bf82f661195a2572f47f4dac8d8 Configs: none
After launching q3e in wayland mode (SDL_VIDEODRIVER=wayland
) cursor gets stuck on the screen: img (and can not be captured with wayland's grim
).
Changing workspaces and then selecting q3e window resolves the issue. This is not happening with ioq3.
Try with recent build
Everything's same.
What SDL version? Pretty sure this is a SDL bug. I saw a commit last month that fixed similar for kde and wayland but this is post 2.0.14 but it mentioned that sway and others may have already been fixed.
Yeah, it's sdl2 2.0.14
.
Try to remove SDL_WINDOW_BORDERLESS
flag for fullscreen mode in sdl_glimp
Doesn't change anything unfortunately.
Try most recent build
https://github.com/ec-/Quake3e/commit/cab52dfee9ff39ccc0a600b65e7c2a8cc903ee8c: same.
Uncomment DEBUG_EVENTS definition in sdl_input.c and show window events order - I suspect that it may be different for x11/wayland backends so gw_active
/ gw_minimized
flags may be not correctly set at initial startup.
It seems like wayland delays input focus a lot comparing to x11, try recent build, I hope it will fix everything. If it doesn't help - provide event log when you're changing workspaces when normal capture occurs
Try to add SDL_SetWindowGrab( SDL_window, SDL_FALSE );
at this line
Also tell if this happens in windowed mode?
SDL_SetWindowGrab( SDL_window, SDL_FALSE );
doesn't work.
Also tell if this happens in windowed mode?
I'm not sure I can do that. sway
instantly launches q3e
in fullscreen and only then I can change it to "windowed". sway
is tiling wm like i3
after all.
I believe etlegacy project recently discovered there's some issues with their new Linux builds and wayland. Plus also some weirdness with fullscreen<>windowed under both.
Perhaps worth checking what they have been investigating and fixing since the 2.77 release.
Try recent build, and show event log
https://github.com/ec-/Quake3e/commit/6ecbc29b5c9565fa531b77e62efa4f8f4f4cc555: w2.txt
https://github.com/ec-/Quake3e/commit/553d4a4c09476e353ced42210052cb46a5d74dc0 fixed the issue with stucked cursor! Thank you!
But there's one catch... After exiting q3e
, cursor remains invisible until I, again, switch between workspaces. This is similar with ioq3
behavior.
I'm installed fedora 33 and tested it in wayland: it seems like mouse should be captured exactly after FOCUS_GAINED
and ENTER
events.
To fix invisible cursor try to insert SDL_ShowCursor( SDL_TRUE );
there
Also I discovered a few other bugs related to sdl2+wayland:
- it bypasses characters to console input when using
CTRL
+key
shortcuts (CTRL+l
for example) - recently pressed key may stuck at
vid_restart
As for me - it looks a bit unstable for everyday use
SDL_ShowCursor( SDL_TRUE );
doesn't fix it.
Unfortunately, this is not reproducible for me on fedora-33 and ubuntu-20.10.
Also, I found another sdl2+wayland-specific bug: repeating key-down events is not sent when you keep some key down, this is mostly noticeable if you want to scroll in-game console
Try with recent buid.
Another sdl2+wayland bug found: SDL_MinimizeWindow( SDL_window );
does not work - hence \minimize
bind is useless
https://github.com/ec-/Quake3e/commit/9fa902327f5850e15e2ab9f1759657f890386ca9: I've noticed that executing q3e
in terminal (tried with alacritty
and foot
) and then exiting the game always makes cursor invisible (in rare cases cursor gets appeard, which is weird). Executing q3e
through wofi
(like dmenu
, but for wayland) on clear workspace always has visible cursor upon exiting.
It's https://github.com/swaywm/sway/issues/6008 bug, sorry for the fuss. While initial issue has been fixed, it's seems like we need to open a new "general sdl2+wayland tracking issue" to track everything in one place.