From 0075ea227994861373b5b9ee0889e64bf079860b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 13 Nov 2007 17:32:47 +0000 Subject: [PATCH] fix another minor bug in DLGC_WANTMESSAGE handling in MSWProcessMessage() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index f6e982303e..dbf35ef999 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2260,10 +2260,10 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) if ( !bCtrlDown ) { // this will contain the dialog code of this - // window and all of its parent windows + // window and all of its parent windows in turn LONG lDlgCode2 = lDlgCode; - while ( win && !win->IsTopLevel() ) + while ( win ) { if ( lDlgCode2 & DLGC_WANTMESSAGE ) { @@ -2273,6 +2273,13 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) return false; } + // don't propagate keyboard messages beyond + // the first top level window parent + if ( win->IsTopLevel() ) + break; + + win = win->GetParent(); + lDlgCode2 = ::SendMessage ( GetHwndOf(win), @@ -2280,8 +2287,6 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) 0, 0 ); - - win = win->GetParent(); } } else // bCtrlDown -- 2.45.2