From b68325114ccf6dea638c67a82683c791e151b2ff Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Sun, 28 Jun 2026 20:52:29 +0800 Subject: [PATCH] steamcompmgr: Reset focusWindow after entering iconic state. After "0a09639d steamcompmgr: Accept any requested iconic state change.", a focus change is required to change the state of a window to ICCCM_NORMAL_STATE. However, ctx->focus.focusWindow is not changed. So, in DetermineAndApplyFocus(), the "if ( prevFocusWindow != ctx->focus.focusWindow )" fails, thus the window is not restored to ICCCM_NORMAL_STATE when expected. Fix RPGMaker Engine games that freeze after minimization. --- src/steamcompmgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index cfdfc3bc74..32a325bf15 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -5539,6 +5539,11 @@ handle_wm_change_state(xwayland_ctx_t *ctx, steamcompmgr_win_t *w, XClientMessag if (state == ICCCM_ICONIC_STATE) { 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 ); + if (x11_win(ctx->focus.focusWindow) == w->xwayland().id) + { + ctx->focus.focusWindow = nullptr; + MakeFocusDirty(); + } } else { xwm_log.debugf("Unhandled WM_CHANGE_STATE to %ld for window 0x%lx", state, w->xwayland().id); }