Wayland SDL shows cursor and hits window limits
Your system information
- System information from steam (
Steam->Help->System Information) in a gist:
- Have you checked for system updates?: Yes
I'm using CS 2 natively under wayland. After the last big update it became unplayable. Before this update I was playing quietly for almost a year.
Steps for reproducing this issue:
- Go to the game folder and modify cs2.sh. Specifically change x11 to wayland
- Go to any server
- Sad. :(
UPDATE
This has been happening since the last 4GB CS 2 update, which was released on October 3. When logging into the server I now have a cursor on the screen at all times that restricts mouse movement, meaning I can't turn the mouse further than the cursor, once the cursor touches the edge of the screen there is no way to turn further.
I tried to play on xwayland, but there I often drop fps, also the scope in the game behaves strangely, as if it floats.
https://github.com/user-attachments/assets/2ee6bd52-7977-43c6-bf38-9cee51f4d846
Hello @VolRen-ShYK, sorry, but you haven't effectively communicated what the issue is that makes the game unplayable for you. Please adjust your opening post to clarify what issue you're seeing and use a more descriptive title, then give me a ping to re-evaluate.
In general, altering cs2.sh and using SDL's wayland backend is not expected to be supported at this time.
@kisak-valve
Hello @icculus, this issue report might be interesting to you, but I don't know the internal details to confirm.
i had the same issue where the game keeps the cursor on the screen inside the match and you can't exceed screen border limits while you try turning around because the cursor gets blocked by the screen edges
@kisak-valve hes mean this
https://github.com/user-attachments/assets/6d41189c-eca4-463e-b0c1-3afb2c08dc4d
@VolRen-ShYK reminder
That means Source 2 still didnt support wayland in 100 %
@ZeroYamaoka Yeah, I realize that. But I wouldn't have written about it if this problem hadn't come up recently. I've been playing smoothly for the whole of this year.
I'm having the same issue. before the armory update I had no issues using wayland.
playing on x11 is garbage having 200fps and it feels like 60
same here, KDE Plasma 6.2 on Fedora 40. when switched to Wayland from X11, cursor is visible and stuck in the window limits, but the X11 performance is so flaky that it's still unplayable (for me, atleast)
Can confirm this issue. With Wayland enabled since one of the recent updates, mouse cursor is visible in game and mouse can hit the limits of the window and block further movements, stopping you from looking around fully.
Edit: for now, I've opted to use gamescope with SDL video driver set to x11. This allows me to use stretched resolution correctly without black bars.
i have this issue as well
this need to be fixed since wayland works way better than x11 for some users
@kisak-valve I apologize for the inconvenience, but wanted to ask you if there has been any progress in resolving this error?
@kisak-valve I apologize for the inconvenience, but wanted to ask you if there has been any progress in resolving this error?
its still the same
Issue still here after latest update
Seems to be related to the mouse_lookup update, maybe. Tested with -vulkan flag and without; same problem. Decreased the mouse speed in the compositor and it decreases sensitivity in game. So, it seems like SDL is not force-grabbing the cursor from the compositor. The compositor seems to be responsible to pass input events to the game.
translated from Chinese
So when will Source 2 support Wayland? XWayland has been underperforming.
XWayland: about 150fps with stuttering Wayland: 230 ~ 250fps
We need this game to support wayland by default more then ever since every major desktop has moved to wayland, xwayland does the job but as other users have noticed, wayland natively is performing better then xwayland, and most users dont want to switch back to x11
Still encountering this issue on the new train update.
Valve plz make Wayland mode great and default 🙂
This was fine for a while. I know it's not supported but X barely gets past 60fps and makes the game feel like a slide deck. XWayland isn't smooth either, but a lot better than plain X.
Can confirm still happening after the latest update.
Noticed the issue on my system as well (Manjaro KDE). As @polluxau pointed out, with many distros switching to Wayland by default, issues like this are going to be showstoppers for folks. Hopefully there's a fix incoming at some point.
Noticed the issue on my system as well (Manjaro KDE). As @polluxau pointed out, with many distros switching to Wayland by default, issues like this are going to be showstoppers for folks. Hopefully there's a fix incoming at some point.
It doesn't default to Wayland yet, so the developers are likely still focused on X11 and Wayland users are expected to use XWayland. Hopefully they spend some time on native Wayland sooner than later.
I have the same issue and also get much better framerates on wayland native, from 200-240 to 350-450. I actually get higher framerates under the wayland native backend than I do on windows and nearly as much fps as I got on csgo, but I also have that mouse cursor bug now.
In previous updates I actually had the opposite issue where the xwayland version wouldn't grab the mouse, and can also confirm that the input isn't raw input.
Noticed the issue on my system as well (Manjaro KDE). As @polluxau pointed out, with many distros switching to Wayland by default, issues like this are going to be showstoppers for folks. Hopefully there's a fix incoming at some point.
It doesn't default to Wayland yet, so the developers are likely still focused on X11 and Wayland users are expected to use XWayland. Hopefully they spend some time on native Wayland sooner than later.
valve recently fixed the steam overlay for wayland native apps so they are spending time on it
Replying to https://github.com/ValveSoftware/csgo-osx-linux/issues/3856#issuecomment-2524869413
That's great to hear :)
This is really an issue about mouse grabbing. I can even see my cursor when I zoom in with an AWP.
I tried some other SDL tweaks, but since the game starts in non-relative mode I suspect it can't be fixed with any environment tweaks. (Also, some old SDL comment said that the Source Engine was notorious for not using relative mode, but I guess that's outdated now with Source 2).
These are some variables I experimented with,
# SDL hints
# https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_hints.h
# Attempt at mouse fix
# export SDL_HINT_TOUCH_MOUSE_EVENTS=0 # 0: Touch events will not generate mouse events
# export SDL_HINT_MOUSE_RELATIVE_MODE_CENTER=1 # 1: Relative mouse mode constrains the mouse to the center of the window
# export SDL_HINT_MOUSE_RELATIVE_MODE_WARP=0 # 0: Use raw input for relative mouse
# export SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE=0 # 0: The cursor will be hidden while relative mode is active (default)
Also, while doing this I ran into a scheduling one that gave me some FPS back, but not enough,
export SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL=1 # 1: Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy
Your results will vary, the kernel+scheduler might need to be modern enough or geared towards real time.
I just noticed that I'm able to play with wayland again. I switched my repo to cachyos and did a full update of my packages.
no issues while playing.
I just noticed that I'm able to play with wayland again. I switched my repo to cachyos and did a full update of my packages.
no issues while playing.
I think cachy os might have a patch for it?
On endeavour os I get the issue still
Still having this issue as well. Do you have a list for the packages you updated?
I just noticed that I'm able to play with wayland again. I switched my repo to cachyos and did a full update of my packages.
no issues while playing.
it's a lot and I have no clue what fixed it
pacman log of updated packages
wayland related
- wayland (1.23.1-1 -> 1.23.1-1.1)
- egl-wayland (4:1.1.16-1 -> 4:1.1.17-1)
- qt6-wayland (6.8.1-1 -> 6.8.1-1.1)
- qt5-wayland (5.15.16+kde+r59-3 -> 5.15.16+kde+r59-3.1)
- kwayland (6.2.4-1 -> 6.2.4-1.1)
- xorg-xwayland (24.1.4-1 -> 24.1.4-1.1)
- wayland-utils (1.2.0-2 -> 1.2.0-2.1)
- kwayland5 (5.116.0-1 -> 5.116.0-1.1)
- kwayland-integration (6.2.4-1 -> 6.2.4-1.1)
- xwaylandvideobridge (0.4.0-2 -> 0.4.0-2.1)
Replying to https://github.com/ValveSoftware/csgo-osx-linux/issues/3856#issuecomment-2539205008
I suspect that the reason could be an update of the egl-wayland package.