Supreeeme / xwayland-satellite

Xwayland outside your Wayland
Mozilla Public License 2.0
176 stars 8 forks source link

Helldivers 2 - black window #44

Closed shumvgolove closed 2 months ago

shumvgolove commented 2 months ago

Software:

Issue

Running Helldivers 2 with any proton version results in black window. Running Helldivers 2 in Sway (without xwayland-satellite) works perfectly fine.

Interesting thing: switching display mode in Helldivers 2 from Fullscreen to Borderless window in Sway session allows the game to display properly in Niri with xwayland-satellite. Strangely, switching display mode back to Fullscreen in Niri session works fine until losing focus on the game (e.g. opening terminal/browser), which results in a black window.

Logs

Nothing interesting at the first glance, but this seems relevant. res_id: 69206017 is the game window.

 2024-07-28T01:34:14.022Z DEBUG xwayland_satellite::xstate            > changed property "_WINE_HWND_STYLE" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.022Z DEBUG xwayland_satellite::xstate            > changed property "_WINE_HWND_EXSTYLE" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.022Z DEBUG xwayland_satellite::xstate            > changed property "_MOTIF_WM_HINTS" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.022Z DEBUG xwayland_satellite::xstate            > changed property "_NET_WM_WINDOW_TYPE" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.022Z DEBUG xwayland_satellite::xstate            > changed property "_NET_WM_ICON" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.186Z DEBUG xwayland_satellite::xstate            > changed property "_WINE_HWND_STYLE" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.186Z DEBUG xwayland_satellite::xstate            > changed property "_WINE_HWND_EXSTYLE" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.186Z DEBUG xwayland_satellite::xstate            > changed property "_MOTIF_WM_HINTS" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.186Z DEBUG xwayland_satellite::xstate            > changed property "_NET_WM_BYPASS_COMPOSITOR" for Window { res_id: 69206017 }
 2024-07-28T01:34:14.186Z DEBUG xwayland_satellite::xstate            > Window { res_id: 69206017 } request: X | Y | WIDTH | HEIGHT | STACK_MODE
 2024-07-28T10:25:21.937Z WARN  xwayland_satellite::xstate        > unrecognized message: Atom { res_id: 513 }
 2024-07-28T10:25:22.011Z WARN  xwayland_satellite::server        > Tried to set window without surface fullscreen: Window { res_id: 69206017 }
 2024-07-28T10:25:22.012Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 2528, height: 1408 }
 2024-07-28T10:25:22.012Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-07-28T10:25:22.125Z WARN  xwayland_satellite::xstate        > unrecognized message: Atom { res_id: 513 }
 2024-07-28T10:25:22.195Z WARN  xwayland_satellite::server        > Tried to set window without surface fullscreen: Window { res_id: 69206017 }
 2024-07-28T10:25:22.196Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 2528, height: 1408 }
 2024-07-28T10:25:22.196Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-07-28T10:25:22.308Z WARN  xwayland_satellite::xstate        > unrecognized message: Atom { res_id: 513 }
 2024-07-28T10:25:22.375Z WARN  xwayland_satellite::server        > Tried to set window without surface fullscreen: Window { res_id: 69206017 }
 2024-07-28T10:25:22.375Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 2528, height: 1408 }
 2024-07-28T10:25:22.375Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-07-28T10:25:22.484Z WARN  xwayland_satellite::xstate        > unrecognized message: Atom { res_id: 513 }
 2024-07-28T10:25:22.554Z WARN  xwayland_satellite::server        > Tried to set window without surface fullscreen: Window { res_id: 69206017 }
 2024-07-28T10:25:22.555Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 2528, height: 1408 }
 2024-07-28T10:25:22.555Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-07-28T10:25:22.663Z WARN  xwayland_satellite::xstate        > unrecognized message: Atom { res_id: 513 }
 2024-07-28T10:25:22.730Z WARN  xwayland_satellite::server        > Tried to set window without surface fullscreen: Window { res_id: 69206017 }
 2024-07-28T10:25:22.730Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 2528, height: 1408 }
 2024-07-28T10:25:22.730Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-07-28T10:25:22.842Z WARN  xwayland_satellite::xstate        > unrecognized message: Atom { res_id: 513 }
 2024-07-28T10:25:22.912Z WARN  xwayland_satellite::server        > Tried to set window without surface fullscreen: Window { res_id: 69206017 }
 2024-07-28T10:25:22.913Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 2528, height: 1408 }
 2024-07-28T10:25:22.913Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-07-28T10:25:23.025Z WARN  xwayland_satellite::xstate        > unrecognized message: Atom { res_id: 513 }
 2024-07-28T10:25:23.100Z WARN  xwayland_satellite::server        > Tried to set window without surface fullscreen: Window { res_id: 69206017 }
 2024-07-28T10:25:23.100Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 2528, height: 1408 }
 2024-07-28T10:25:23.100Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
shumvgolove commented 2 months ago

Hmm, upon further testing I think this is Niri issue: running the game directly with Xwayland or gamescope also produces a black window.

shumvgolove commented 2 months ago

Seems not like a Niri issue, reopening.

shumvgolove commented 2 months ago

Also, here's something interesting:

 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > _NET_WM_STATE (Remove) props: Atom { res_id: 290 } Atom { res_id: 0 }
 2024-07-28T20:45:15.691Z DEBUG xwayland_satellite::server::event     > configuring toplevel 2560x1440, [4, 0, 0, 0, 2, 0, 0, 0]
 2024-07-28T20:45:15.691Z DEBUG xwayland_satellite::server::event     > configuring Window { res_id: 50331649 }: 0x0, 2560x1440
 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > reconfiguring window Window { res_id: 50331649 }
 2024-07-28T20:45:15.691Z DEBUG xwayland_satellite::server            > focusing window Window { res_id: 50331649 }
 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > x11 event: X(ClientMessage(ClientMessageEvent { response_type: 161, format: 32, sequence: 653, window: Window { res_id: 50331649 }, r#type: Atom { res_id: 248 }, data: Data32([0, 289, 0, 1, 0]) }))
 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > _NET_WM_STATE (Remove) props: Atom { res_id: 289 } Atom { res_id: 0 }
 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > x11 event: X(PropertyNotify(PropertyNotifyEvent { response_type: 28, pad: 1, sequence: 653, window: Window { res_id: 50331649 }, atom: Atom { res_id: 375 }, time: 580874, state: NewValue, pad: 3 }))
 2024-07-28T20:45:15.691Z DEBUG xwayland_satellite::xstate            > changed property "_NET_WM_BYPASS_COMPOSITOR" for Window { res_id: 50331649 }
 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > x11 event: X(ConfigureNotify(ConfigureNotifyEvent { response_type: 22, pad: 1, sequence: 654, event: Window { res_id: 1045 }, window: Window { res_id: 50331649 }, above_sibling: Window { res_id: 60817410 }, x: 0, y: 0, width: 2560, height: 1440, border_width: 0, override_redirect: false, pad: 1 }))
 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > x11 event: X(PropertyNotify(PropertyNotifyEvent { response_type: 28, pad: 1, sequence: 661, window: Window { res_id: 50331649 }, atom: Atom { res_id: 248 }, time: 580875, state: NewValue, pad: 3 }))
 2024-07-28T20:45:15.691Z DEBUG xwayland_satellite::xstate            > changed property "_NET_WM_STATE" for Window { res_id: 50331649 }
 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > x11 event: X(ConfigureNotify(ConfigureNotifyEvent { response_type: 22, pad: 1, sequence: 672, event: Window { res_id: 1045 }, window: Window { res_id: 50331649 }, above_sibling: Window { res_id: 60817410 }, x: 380, y: 0, width: 2560, height: 1440, border_width: 0, override_redirect: false, pad: 1 }))
 2024-07-28T20:45:15.691Z TRACE xwayland_satellite::xstate            > x11 event: X(ConfigureNotify(ConfigureNotifyEvent { response_type: 22, pad: 1, sequence: 679, event: Window { res_id: 1045 }, window: Window { res_id: 50331649 }, above_sibling: Window { res_id: 60817410 }, x: 0, y: 0, width: 2560, height: 1440, border_width: 0, override_redirect: false, pad: 1 }))
 2024-07-28T20:45:16.343Z TRACE xwayland_satellite::xstate            > x11 event: X(ConfigureNotify(ConfigureNotifyEvent { response_type: 22, pad: 1, sequence: 689, event: Window { res_id: 1045 }, window: Window { res_id: 60817409 }, above_sibling: Window { res_id: 27263107 }, x: 380, y: 0, width: 1800, height: 1440, border_width: 0, override_redirect: true, pad: 1 }))
 2024-07-28T20:45:16.343Z TRACE xwayland_satellite::xstate            > x11 event: X(MapNotify(MapNotifyEvent { response_type: 19, pad: 1, sequence: 689, event: Window { res_id: 1045 }, window: Window { res_id: 60817409 }, override_redirect: true, pad: 3 }))
 2024-07-28T20:45:16.343Z DEBUG xwayland_satellite::xstate            > got title: None
 2024-07-28T20:45:16.343Z DEBUG xwayland_satellite::server            > mapping Window { res_id: 60817409 }
 2024-07-28T20:45:16.369Z TRACE xwayland_satellite::xstate            > x11 event: X(ConfigureRequest(ConfigureRequestEvent { response_type: 23, stack_mode: Above, sequence: 698, parent: Window { res_id: 1045 }, window: Window { res_id: 50331649 }, sibling: Window { res_id: 0 }, x: -32000, y: -32000, width: 160, height: 31, border_width: 0, value_mask: X | Y | WIDTH | HEIGHT }))
 2024-07-28T20:45:16.369Z DEBUG xwayland_satellite::xstate            > Window { res_id: 50331649 } request: X | Y | WIDTH | HEIGHT
thread '<unnamed>' panicked at ./src/lib.rs:91:52:
called `Result::unwrap()` on an `Err` value: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }
stack backtrace:
   0:     0x5bac110681f0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1557845c8e738a27
   1:     0x5bac10f9294b - core::fmt::write::hcc4af7a39f871458
   2:     0x5bac110654f3 - std::io::Write::write_fmt::h2e58768ec339f8e4
   3:     0x5bac11067f6e - std::sys_common::backtrace::print::h3472d9e8ff95a48d
   4:     0x5bac110693fe - std::panicking::default_hook::{{closure}}::hedc6d80425a5f543
   5:     0x5bac110690e6 - std::panicking::default_hook::hfd8eb046669a0df4
   6:     0x5bac11069a0f - std::panicking::rust_panic_with_hook::h65b2a82740c1271c
   7:     0x5bac110697f4 - std::panicking::begin_panic_handler::{{closure}}::h93c97270af2611f9
   8:     0x5bac110686b9 - std::sys_common::backtrace::__rust_end_short_backtrace::h829948e6034c0cd2
   9:     0x5bac11069557 - rust_begin_unwind
  10:     0x5bac10f91243 - core::panicking::panic_fmt::hfc53808b4f190311
  11:     0x5bac10f916e6 - core::result::unwrap_failed::hccb2dcc79e29bd4a
  12:     0x5bac1116b364 - std::sys_common::backtrace::__rust_begin_short_backtrace::h65020462f70c50e7
  13:     0x5bac11172248 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb2f115beaca3d3d4
  14:     0x5bac1106c4bb - std::sys::pal::unix::thread::Thread::new::thread_start::h116c3f3c1780c052
zsh: abort      xwayland-satellite
shumvgolove commented 2 months ago

Yeah, should've googled the problem before randomly opening the issues... It's a known problem.

Closing.

Supreeeme commented 2 months ago

Known problem with what?

shumvgolove commented 2 months ago

Based on user reports in Proton Github and Reddit, game is just behaving in... strange ways. I guess Helldivers 2 needs some kind of workaround in Wine/Proton.

I've come up with two "solutions" for now:

  1. The weird one Upon launching, the game spawns several windows: one for the tray icon and one for the actual game. After launching, focus stays on the "tray icon" window, and focusing the game does nothing - it just stays black. However, if you're quick enough to focus the game window just as the "tray icon" spawns, the game... starts rendering. Losing focus on the game renders it permanently black, though.

Here's the video demonstration:

https://github.com/user-attachments/assets/a0843b0b-5789-4ece-b6bd-9b7c7fe886d8

https://github.com/user-attachments/assets/72f7678c-1698-4bf3-bf7f-7b899ffd8662

https://github.com/user-attachments/assets/5fa84da6-c583-490b-ac78-2e326f197def

¯\_(ツ)_/¯

  1. Gamescope Running the game with Gamescope works for me with the following arguments: gamescope -e -f -W 2560 -H 1440 -- %command%. The catch is that you need to "unfullscreen" and "fullscreen" it to work properly, otherwise it stays black.