From: Zhiyi Zhang <zzhang@codeweavers.com> KWin handles UnmapNotify events from XWithdrawWindow() by first setting WM_STATE to WithdrawnState, then deleting the WM_STATE property, then setting it to IconicState. This means there is an unexpected IconicState when we are expecting WithdrawnState. Since 4c07e556, Wine goes through WithdrawnState when transitioning from IconicState to NormalState. The IconicState state can cause an application to stuck at an unexpected state because its overwrites the desired NormalState. While we could not go through WithdrawnState when on KWin, this fix doesn't require a WM check. Fix RiME(493200) sometimes fails to restore from Alt+Tab. --- dlls/winex11.drv/window.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index d2d53a40be3..528126a0f3a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1865,7 +1865,9 @@ void window_wm_state_notify( struct x11drv_win_data *data, unsigned long serial, received = wine_dbg_sprintf( "WM_STATE %#x/%lu", value, serial ); expected = *expect_serial ? wine_dbg_sprintf( ", expected %#x/%lu", *pending, *expect_serial ) : ""; /* ignore Metacity/Mutter transient NormalState during WithdrawnState <-> IconicState transitions */ - if (value == NormalState && *current + *pending == IconicState) reason = "transient "; + if (value == NormalState && *current + *pending == IconicState) reason = "transient NormalState "; + /* ignore KWin transient IconicState when entering WithdrawnState */ + if (value == IconicState && *pending == WithdrawnState) reason = "transient IconicState "; if (!handle_state_change( serial, expect_serial, sizeof(value), &value, desired, pending, current, expected, prefix, received, reason )) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10949