http://bugs.winehq.org/show_bug.cgi?id=32594
Bug #: 32594 Summary: MessageBox hook WH_CBT HCBT_ACTIVATE sees wrong button size given MB_DEFBUTTON* style Product: Wine Version: 1.5.20 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: staticinline@gmail.com Classification: Unclassified
MessageBox buttons are not correctly sized during the first call to a WH_CBT HCBT_ACTIVATE hook if a MB_DEFBUTTON* style is used on the message box.
Observe in the Wine msgbox.c:MSGBOX_OnInit code, the "position the buttons" loop iterates through each button, and if a button has a MB_DEFMASK set, it also calls SetFocus, which triggers the WH_CBT HCBT_ACTIVATE hook. This is before this loop positions the remaining buttons. The attached wine-msgbox-patch.txt is a patch to Wine 1.5.20 that positions all the buttons before processing the MB_DEFMASK.
This problem affects programs using the wxWidgets 2.9.x GUI library, whose message box implementation measures (via GetWindowRec) the initial sizes of the buttons during a WH_CBT HCBT_ACTIVATE hook [2]. This problem is analyzed more fully in a wxWidgets ticket [1].
The problem has also been observed to affect at least as far back as Wine 1.0.1 (debian squeeze, x86).
[1] http://trac.wxwidgets.org/ticket/14926 [2] http://trac.wxwidgets.org/browser/wxWidgets/trunk/src/msw/msgdlg.cpp#L369
http://bugs.winehq.org/show_bug.cgi?id=32594
--- Comment #1 from staticinline@gmail.com 2012-12-29 15:39:21 CST --- Created attachment 43010 --> http://bugs.winehq.org/attachment.cgi?id=43010 patch to msgbox.c
http://bugs.winehq.org/show_bug.cgi?id=32594
--- Comment #2 from Bruno Jesus 00cpxxx@gmail.com 2013-01-10 19:25:05 CST --- Hi, patches are not picked up from bugzilla, please send to wine-patches@winehq.org
You will possibly need a test (not a program, a test ported into the wine test inside the dlls/user32/tests folder) to prove the change is right.
For some input you can also have a look at: http://wiki.winehq.org/SubmittingPatches
Thanks for the effort.
https://bugs.winehq.org/show_bug.cgi?id=32594
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source
--- Comment #3 from Austin English austinenglish@gmail.com --- Source is unchanged in 1.7.35.
https://bugs.winehq.org/show_bug.cgi?id=32594
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=32594
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=32594
--- Comment #4 from super_man@post.com --- (In reply to Austin English from comment #3)
Source is unchanged in 1.7.35.
patching file dlls/user32/msgbox.c Hunk #1 succeeded at 297 (offset -2 lines).
against wine 1.9.12