Files
pristontale-eu-linux/ptlinux/native/gamescope-keep-nested-windows-visible.patch

35 lines
1.5 KiB
Diff

From: PT Linux Launcher maintainers
Subject: Keep the nested game window visible during its login transition
PristonTale replaces its startup presentation while entering the login screen
and asks the nested X11 window manager to mark the game window iconic. Gamescope
3.16.20 acknowledges that request by publishing IconicState even though the
surface stays mapped. Wine then hides or resizes the client, which also changes
the outer Gamescope presentation.
When the launcher opts in through PTLINUX_GAMESCOPE_KEEP_WINDOWS_VISIBLE, keep
the nested client in NormalState. This is scoped to the launcher environment;
Gamescope retains its upstream behavior for every other invocation. Desktop
minimize and focus operate on the outer Wayland window and remain unaffected.
--- a/src/steamcompmgr.cpp
+++ b/src/steamcompmgr.cpp
@@ -5361,8 +5361,17 @@ static void
handle_wm_change_state(xwayland_ctx_t *ctx, steamcompmgr_win_t *w, XClientMessageEvent *ev)
{
long state = ev->data.l[0];
+ static const bool bKeepNestedWindowsVisible = env_to_bool(
+ getenv( "PTLINUX_GAMESCOPE_KEEP_WINDOWS_VISIBLE" ) );
if (state == ICCCM_ICONIC_STATE) {
+ if ( bKeepNestedWindowsVisible )
+ {
+ xwm_log.debugf("Ignoring WM_CHANGE_STATE to ICONIC for window 0x%lx", w->xwayland().id);
+ set_wm_state( ctx, w->xwayland().id, ICCCM_NORMAL_STATE );
+ return;
+ }
+
xwm_log.debugf("Faking WM_CHANGE_STATE to ICONIC for window 0x%lx", w->xwayland().id);
set_wm_state( ctx, w->xwayland().id, ICCCM_ICONIC_STATE );
} else {