csgo-osx-linux icon indicating copy to clipboard operation
csgo-osx-linux copied to clipboard

Wayland SDL shows cursor and hits window limits

Open VolRencs opened this issue 1 year ago • 9 comments

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:

  1. Go to the game folder and modify cs2.sh. Specifically change x11 to wayland
  2. Go to any server
  3. 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

VolRencs avatar Oct 09 '24 12:10 VolRencs

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 avatar Oct 09 '24 12:10 kisak-valve

@kisak-valve

VolRencs avatar Oct 09 '24 13:10 VolRencs

Hello @icculus, this issue report might be interesting to you, but I don't know the internal details to confirm.

kisak-valve avatar Oct 09 '24 13:10 kisak-valve

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

firashacker avatar Oct 09 '24 22:10 firashacker

@kisak-valve hes mean this

https://github.com/user-attachments/assets/6d41189c-eca4-463e-b0c1-3afb2c08dc4d

@VolRen-ShYK reminder Zrzut ekranu_20241011_122924 That means Source 2 still didnt support wayland in 100 %

ZeroYamaoka avatar Oct 11 '24 10:10 ZeroYamaoka

@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.

VolRencs avatar Oct 11 '24 12:10 VolRencs

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

ParadoxLeon avatar Oct 12 '24 18:10 ParadoxLeon

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)

witchfuneral avatar Oct 13 '24 03:10 witchfuneral

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.

fxzzi avatar Oct 13 '24 09:10 fxzzi

i have this issue as well

this need to be fixed since wayland works way better than x11 for some users

firashacker avatar Oct 21 '24 11:10 firashacker

@kisak-valve I apologize for the inconvenience, but wanted to ask you if there has been any progress in resolving this error?

VolRencs avatar Oct 21 '24 13:10 VolRencs

@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

firashacker avatar Oct 21 '24 13:10 firashacker

Issue still here after latest update

fxzzi avatar Oct 30 '24 18:10 fxzzi

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.

dineshdevkota001 avatar Nov 02 '24 16:11 dineshdevkota001

translated from Chinese

So when will Source 2 support Wayland? XWayland has been underperforming.

XWayland: about 150fps with stuttering Wayland: 230 ~ 250fps

Wanye-7300 avatar Nov 12 '24 14:11 Wanye-7300

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

pollux78 avatar Nov 15 '24 23:11 pollux78

Still encountering this issue on the new train update.

fxzzi avatar Nov 15 '24 23:11 fxzzi

Valve plz make Wayland mode great and default 🙂

PacketAuditor avatar Nov 21 '24 16:11 PacketAuditor

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.

Dietr1ch avatar Nov 25 '24 01:11 Dietr1ch

Can confirm still happening after the latest update.

fxzzi avatar Nov 30 '24 16:11 fxzzi

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.

CaptainSiscold avatar Dec 02 '24 23:12 CaptainSiscold

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.

PacketAuditor avatar Dec 02 '24 23:12 PacketAuditor

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

freebritney132 avatar Dec 07 '24 04:12 freebritney132

Replying to https://github.com/ValveSoftware/csgo-osx-linux/issues/3856#issuecomment-2524869413

That's great to hear :)

pollux78 avatar Dec 07 '24 04:12 pollux78

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.

Dietr1ch avatar Dec 07 '24 12:12 Dietr1ch

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.

ParadoxLeon avatar Dec 11 '24 15:12 ParadoxLeon

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

pollux78 avatar Dec 11 '24 16:12 pollux78

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.

BJET67 avatar Dec 12 '24 14:12 BJET67

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)

ParadoxLeon avatar Dec 12 '24 15:12 ParadoxLeon

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.

VolRencs avatar Dec 12 '24 18:12 VolRencs