argh, another IsDialogMessage() fix: we still need to check all non top level parents
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2084,16 +2084,27 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
|
|||||||
// has WS_EX_CONTROLPARENT style, so don't call it in this case
|
// has WS_EX_CONTROLPARENT style, so don't call it in this case
|
||||||
bool canSafelyCallIsDlgMsg = TRUE;
|
bool canSafelyCallIsDlgMsg = TRUE;
|
||||||
|
|
||||||
HWND hwnd = ::GetFocus();
|
HWND hwndFocus = ::GetFocus();
|
||||||
if ( hwnd && !(::IsWindowEnabled(hwnd) && ::IsWindowVisible(hwnd)) )
|
while ( hwndFocus )
|
||||||
{
|
{
|
||||||
hwnd = ::GetParent(hwnd);
|
if ( !::IsWindowEnabled(hwndFocus) ||
|
||||||
if ( hwnd &&
|
!::IsWindowVisible(hwndFocus) )
|
||||||
(::GetWindowLong(hwnd, GWL_STYLE) & WS_EX_CONTROLPARENT) )
|
|
||||||
{
|
{
|
||||||
// it would enter an infinite loop if we do this!
|
// it would enter an infinite loop if we do this!
|
||||||
canSafelyCallIsDlgMsg = FALSE;
|
canSafelyCallIsDlgMsg = FALSE;
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !(::GetWindowLong(hwndFocus, GWL_STYLE) & WS_CHILD) )
|
||||||
|
{
|
||||||
|
// it's a top level window, don't go further -- e.g. even
|
||||||
|
// if the parent of a dialog is disabled, this doesn't
|
||||||
|
// break navigation inside the dialog
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
hwndFocus = ::GetParent(hwndFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( canSafelyCallIsDlgMsg && ::IsDialogMessage(GetHwnd(), msg) )
|
if ( canSafelyCallIsDlgMsg && ::IsDialogMessage(GetHwnd(), msg) )
|
||||||
|
Reference in New Issue
Block a user