http://bugs.winehq.org/show_bug.cgi?id=24773
Summary: It is possible to click behind certain modal dialogs in Worms Armageddon, leading to loss of focus and crashes Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: thecybershadow@gmail.com
Created an attachment (id=31310) --> (http://bugs.winehq.org/attachment.cgi?id=31310) Proposed patch
Problem description:
It is possible to click behind modal dialogs displayed in e.g. the Weapon Options screen. This causes the modal pop-up window to lose focus and go behind the Weapon Options screen. It continues to be drawn in front on the Weapon Options screen, however input events go to the Weapon Options screen instead. Attempting to close the Weapon Options screen causes the game to crash.
Analysis:
1. It is possible to click behind certain modal dialogs because they are not disabled. 2. The reason why they are not disabled, is that the MFC code which brings up a new modal dialog disables the wrong window. 3. The reason for which the wrong window is disabled, is because the Wine implementation of GetLastActivePopup, which is used by MFC to find the active dialog to disable, returns an incorrect value in certain cases. Specifically, it doesn't work correctly with nested popups. 4. The reason for that is that a new popup of an owned window doesn't update the root window's "last active" window. As seen in Wine's make_window_active, only the immediate owner is updated.
Attached patch + test (will send to wine-patches).