swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.41k stars 1.1k forks source link

Counter Strike 2 (Steam game) runs in fullscreen, but Sway thinks it's not #8305

Open o-alquimista opened 3 weeks ago

o-alquimista commented 3 weeks ago

Please fill out the following:

              "name": "Counter-Strike 2",
              "window": 44040218,
              "nodes": [],
              "floating_nodes": [],
              "focus": [],
              "fullscreen_mode": 0,
              "sticky": false,
              "pid": 9659,
              "app_id": null,
              "visible": false,
              "max_render_time": 0,
              "shell": "xwayland",
              "inhibit_idle": false,
              "idle_inhibitors": {
                "user": "fullscreen",
                "application": "none"
              },

See full output here: https://gist.github.com/o-alquimista/821755fd1133c90bf8b73b045234cd81#file-swaymsg-t-get_tree

This is a screenshot of the whole screen while running the game: 20240819_13h37m29s_grim

With the workspace in focus, if I press $mod+f once, fullscreen_mode turns to 1; and, as a consequence, idle inhibitors and mako's do-not-disturb mode start working.


~Possibly related: missing refresh rate option 75hz (only 60hz is available on Sway). On other desktops like Xfce or GNOME, 75hz is available.~


Workaround:

for_window [instance="cs2" class="SDL Application"] fullscreen enable
emersion commented 3 weeks ago

Maybe it's in a weird X11 mode where it's not fullscreen but it's positioned as if? Can you obtain an xwininfo and xprop dump of the window when it's in this state?

o-alquimista commented 3 weeks ago

xwininfo:

xwininfo: Window id: 0x360001a "Counter-Strike 2"

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 2560
  Height: 1080
  Depth: 24
  Visual: 0x42
  Visual Class: DirectColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x3600019 (not installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -0+0  -0-0  +0-0
  -geometry 2560x1080+0+0

xprop:

_NET_WM_USER_TIME(CARDINAL) = 978928
_NET_WM_ICON(CARDINAL) = 
_VARIABLE_REFRESH(CARDINAL) = 1
_NET_WM_STATE(ATOM) = _NET_WM_STATE_FOCUSED
WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0x0
XdndAware(ATOM) = BITMAP
_NET_WM_NAME(UTF8_STRING) = "Counter-Strike 2"
WM_NAME(UTF-8) = "Counter-Strike 2"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 1
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_PID(CARDINAL) = 28893
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "cs2", "SDL Application"
WM_HINTS(WM_HINTS):
        Client accepts input or input focus: True
        window id # of group leader: 0xeb90a82d
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        user specified location: 0, 0
        program specified minimum size: 2560 by 1080
        program specified maximum size: 2560 by 1080
WM_CLIENT_MACHINE(STRING) = "helium"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
STEAM_GAME(CARDINAL) = 730
kennylevinsen commented 1 week ago

It doesn't look like the window is fullscreen, but rather just happens to be a big floating window. Does i3 report this any differently?

o-alquimista commented 1 week ago

From i3

i3-msg -t get_tree: https://gist.github.com/o-alquimista/821755fd1133c90bf8b73b045234cd81#file-i3-msg-t-get_tree-json

xwininfo:

xwininfo: Window id: 0x3c0001a "Counter-Strike 2"

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 2560
  Height: 1080
  Depth: 24
  Visual: 0x22
  Visual Class: DirectColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x3c00019 (not installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -0+0  -0-0  +0-0
  -geometry 2560x1080+0+0

xprop:

_NET_WM_USER_TIME(CARDINAL) = 2464627
_NET_WM_ICON(CARDINAL) = 
_VARIABLE_REFRESH(CARDINAL) = 1
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_FOCUSED
WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0x0
I3_FLOATING_WINDOW(CARDINAL) = 1
XdndAware(ATOM) = BITMAP
_NET_WM_NAME(UTF8_STRING) = "Counter-Strike 2"
WM_NAME(UTF-8) = "Counter-Strike 2"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 1
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_PID(CARDINAL) = 322
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "cs2", "SDL Application"
WM_HINTS(WM_HINTS):
        Client accepts input or input focus: True
        window id # of group leader: 0x111ffdb2
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        user specified location: 0, 0
        program specified minimum size: 2560 by 1080
        program specified maximum size: 2560 by 1080
WM_CLIENT_MACHINE(STRING) = "helium"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
STEAM_GAME(CARDINAL) = 730

It doesn't look any different from Sway, if I'm reading this correctly.

One difference I see is that the refresh rate options in-game includes 75hz when running i3; but that's probably not related to this fullscreen issue.

Possibly related: missing refresh rate option 75hz (only 60hz is available on Sway). On other desktops like Xfce or GNOME, 75hz is available.

kennylevinsen commented 1 week ago

It doesn't look like i3 considers the window fullscreen either - it's just a big floating window there.