Counter-Strike 2

Counter-Strike 2

Not enough ratings
How to fix Fullscreen on Linux
By RuthlessFaction
Is the -fullscreen launch option not working for you on linux?

I've found what the problem is and have a simple solution.
   
Award
Favorite
Favorited
Unfavorite
What's the Issue?
When launching on a display at a resolution other than the current display's resolution, CS2 refuses to actually go fullscreen. Adding the
-fullscreen
launch option does not help.

Here, the native resolution of 3440x1440@99Hz is the desktop resolution. Launching CS2 fullscreen should work but it doesn't when the game resolution is set to 2560x1080.

Manual Workaround?
Now, a manual workaround of setting the in game setting to "Windowed" and back to "Fullscreen" does work... but this is extremely annoying to do everytime you launch...

So what happens when it is working? Well CS2 actually changes the display's resolution. Fortunately, we can do this with our Launch Options!
So how do we fix it?
X11 Displays
For Xorg sessions, the display resolution can be adjusted using the xrandr[manpages.debian.org] package.

first from a terminal, run
xrandr
to view which monitors are connected and available resolutions.


from here we can build our Launch Options:

xrandr --output HDMI-A-0 --mode 2560x1080 --refresh 120; %command% -w 2560 -h 1080 -freq 120 -fullscreen; xrandr --output HDMI-A-0 --mode 3440x1440 --refresh 99.98

What this does is specify the target resolution for the display, then launch CS2 with the same resolution in fullscreen, and then when the game is quit, it returns the display to the native resolution

Wayland Displays
Disclaimer: I do not have a Wayland desktop to test if this is even a problem or if this fix works

For wayland displays, xrandr won't work. But there is an equivalent wlr-randr[manpages.debian.org] that works for SOME compositors.

wl-randr will NOT work for KDE or GNOME running their default wayland compositors as they are not based on wlroots

For wayland compositors based on wlroots, try the following:
wlr-randr --output HDMI-A-0 --mode 2560x1080@120; %command% -w 2560 -h 1080 -freq 120 -fullscreen; wlr-randr --output HDMI-A-0 --mode 3440x1440@99.98

For GNOME, you might try gnome-monitor-config[github.com] to achieve the same result:
Congrats!
Hopefully this solution helps until Valve can get around to fixing the bug!

The basic ideas from above can be adapted as necessary to suit your needs.
1 Comments
;smK'alvo 23 Sep, 2024 @ 7:52am 
You are awesome! having trouble with this since launch! :csgocross::csgocross: