[Bug 5402] Multiple MFC-based apps crash during non-modal child dialog control creation with active window being zero (Canon PhotoStitch 3.1.13, Flexible Renamer v8.4)
wine-bugs at winehq.org
wine-bugs at winehq.org
Sun Jun 21 08:43:47 CDT 2015
https://bugs.winehq.org/show_bug.cgi?id=5402
Anastasius Focht <focht at gmx.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|-unknown |user32
Summary|Canon PhotoStitch 3.1.13 |Multiple MFC-based apps
|crashes on startup |crash during non-modal
| |child dialog control
| |creation with active window
| |being zero (Canon
| |PhotoStitch 3.1.13,
| |Flexible Renamer v8.4)
--- Comment #39 from Anastasius Focht <focht at gmx.net> ---
Hello folks,
reviving this old bug again as another app was found which suffers from same
problem: bug 32304 ("Flexible Renamer v8.4 crashes on startup (no active window
after child dialog controls creation)")
Quoting myself:
--- quote ---
For testing purpose I made the top-most parent window which is not a child
window the active window in the non-modal case, after the dialog controls are
created and the default focus assignment is handled.
Basically searching all ancestors until a non-child top window is found which
is not a desktop window (the main app window).
It made the apps from both bugs work.
The change might not be correct but narrows down an area to investigate further
on.
--- quote ---
I tried to limit the impact by adding code only in focus handling.
This might need to be put in larger scope - your task to figure out ;-)
Source:
https://source.winehq.org/git/wine.git/blob/6c5d4cb07e6ddc578cd8f6b359f51c76c6231113:/dlls/user32/dialog.c#l483
--- snip ---
483 static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
484 HWND owner, DLGPROC dlgProc, LPARAM param,
485 BOOL unicode, BOOL modal )
486 {
487 HWND hwnd;
488 RECT rect;
489 POINT pos;
...
691 /* Create controls */
692
693 if (DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst,
unicode ))
694 {
695 /* Send initialisation messages and set focus */
696
697 if (dlgProc)
698 {
699 HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE );
700 if (!focus) focus = GetNextDlgGroupItem( hwnd, 0, FALSE );
701 if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param )
&& IsWindow( hwnd ) &&
702 ((~template.style & DS_CONTROL) || (template.style &
WS_VISIBLE)))
703 {
704 /* By returning TRUE, app has requested a default focus
assignment.
705 * WM_INITDIALOG may have changed the tab order, so find
the first
706 * tabstop control again. */
707 focus = GetNextDlgTabItem( hwnd, 0, FALSE );
708 if (!focus) focus = GetNextDlgGroupItem( hwnd, 0, FALSE );
709 if (focus)
710 SetFocus( focus );
711 }
712 }
713
714 if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd,
GWL_STYLE ) & WS_VISIBLE))
715 {
716 ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always
work */
717 }
718 return hwnd;
719 }
...
723 }
--- snip ---
$ wine --version
wine-1.7.45-146-gaf55ae1
Regards
--
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