Skip to content

Fix Steam cursor in gamescope#27

Open
TobiPeterG wants to merge 1 commit intoChimeraOS:mainfrom
TobiPeterG:main
Open

Fix Steam cursor in gamescope#27
TobiPeterG wants to merge 1 commit intoChimeraOS:mainfrom
TobiPeterG:main

Conversation

@TobiPeterG
Copy link

I noticed that the cursor in game mode is often not the steam cursor it should be. This fixes it. Can this be confirmed? :)

mkdir -p ~/.config/gtk-3.0
touch ~/.config/gtk-3.0/settings.ini
sed -i 's/^gtk-cursor-theme-name=.*/gtk-cursor-theme-name=steam/' ~/.config/gtk-3.0/settings.ini
sed -i 's/^gtk-cursor-theme-size=.*/gtk-cursor-theme-size=32/' ~/.config/gtk-3.0/settings.ini
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it would affect desktop mode as well.

I think it would be better to use the --cursor gamescope option instead.

Copy link
Author

@TobiPeterG TobiPeterG Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debugged it a bit.
(starting steam with "gamescope --cursor CURSORFILE.png /usr/bin/steam")
Yes, using --cursor would be correct. The current setting can't work anymore because the image file in /home doesn't exist anymore on Steam's side.
However, I noticed that gamescope is most of the times not using the cursor one specifies (there is also a message here sometimes:

Desktop state changed: desktop: { pos:    0,   0 size: 1280, 720 } primary: { pos:    0,   0 size: 1280, 720 }
Caching cursor image for , size 10x16, serial 47, cache size = 0

This behaviour can be seen on upstream gamescope as well as gamescope-plus

Will look at this further

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I open a ticket about this on their gamescope repo?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the cursor in this file: ~/.config/gtk-3.0/settings.ini seems to have an influence though which is really weird.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I found this issue:
ValveSoftware/gamescope#1438

So steam is actually using the GTK cursor theme no matter what we set with --cursor. So something like I propose needs to be done.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, so I found that this is what steamOS is doing:

export XCURSOR_THEME=steam
export XCURSOR_SCALE=256

# Chromium (and therefore Steam) ignore XCursor and use on the GTK config
kwriteconfig5 --file gtk-3.0/settings.ini  --group Settings --key gtk-cursor-theme-name steam

Which is exactly what I'm injecting manually. :)

Signed-off-by: TobiPeterG <github.threefold020@passmail.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants