[Bug 23745] warcraft 3 freeze when desktop switching/minimize

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Jan 26 03:48:58 CST 2011


http://bugs.winehq.org/show_bug.cgi?id=23745

--- Comment #22 from Roman <m01brv at mail.ru> 2011-01-26 03:48:57 CST ---
I've done some investigation tracing the "event" debug channel and some others
(with WINEDEBUG). I found that this bug emerges due to the following piece of
code in handle_wm_state_notify of /dlls/winex11drv/event.c:

if (is_net_wm_state_maximized( event->display, data ))
{
    if ((style & WS_MAXIMIZEBOX) && !(style & WS_DISABLED))
    {
        TRACE( "restoring to max %p/%lx\n", data->hwnd, data->whole_window );
        SendMessageW( data->hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0 );
    }
    else TRACE( "not restoring to max win %p/%lx style %08x\n",
                data->hwnd, data->whole_window, style );
}
else if (style & (WS_MINIMIZE | WS_MAXIMIZE))
{
    TRACE( "restoring win %p/%lx\n", data->hwnd, data->whole_window );
    SendMessageW( data->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0 );
}
else TRACE( "not restoring win %p/%lx style %08x\n", data->hwnd,
data->whole_window, style );

The minimized game window is marked as "maximized" by KWin. This can be checked
by right-clicking on the game icon in the taskbar: both "minimize" and
"maximize" checkboxes are ticked. So is_net_wm_state_maximized returns true,
but the wine's WS_MAXIMIZEBOX flag is unset, so the execution goes to the first
"else" branch ("not restoring to max win"). I am not a windows programmer, but
I found in the web that WS_MAXIMIZEBOX should mean only that the window does
not have the maximize button. I do not see a reason why such windows should not
be restored, although this window style could apparently contradict to the fact
that WM thinks the window is maximized. Maybe wine mistakenly registered the
window (in the WM) as maximized one somewhen earlier. Note that when the game
window is in the normal fullscreen state, the "maximized" box from the taskbar
right-click menu is grayed out and unchecked.

Note: the minimized game window possesses the following style flags: WS_POPUP,
WS_MINIMIZE, WS_VISIBLE, WS_CLIPSIBLINGS, WS_CLIPCHILDREN (as it follows from
the debug log when I try to restore the window)

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list