ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
633 stars 74 forks source link

[TF2] [Linux] Switching to/from fullscreen modes tends to result in a freeze #5454

Open purplebar0 opened 6 months ago

purplebar0 commented 6 months ago

Edit: It seems like simply using windowed mode is the way to go -- forcing fullscreen in i3 WM (and possibly any other WM/DE) is sufficient to achieve variable refresh rate, for example, even though it's not a "true" fullscreen mode.


This issue appears to effect both the public and x64 beta branches (edit: Half-Life 2 as well). It is supposedly not a new issue.

Either using no X11 compositor or enabling compositor redirection (for Picom, it's achieved by enabling unredir-if-possible = true), the game sometimes permanently freezes if it switches from fullscreen to windowed or vice versa. It also happens when the game is started with -fullscreen or fullscreen mode selected beforehand.

I should note that I force system-provided SDL2 (LD_PRELOAD="/usr/\$LIB/libSDL2.so:$LD_PRELOAD" %command%), which is yet to be provided in the x64 beta even, since the outdated one that ships with the game makes the game switch to windowed mode if the game loses focus, and has issues with copying text into other applications, among other issues.

purplebar0 commented 6 months ago

It might be a picom bug for all I know.

The following workaround fixed this issue for TF2 but not HL2.

  1. Install Feral GameMode
  2. Inside ~/.config/gamemode.ini, add these lines:
    [custom]
    start=killall picom || true
    end=picom -b &
  3. Add this to launch options:
    gamemoderun %command%

It might instead help tweaking other Picom configuration entries related to unredirecting, perhaps the delay and blacklist for further results.