]> git.saurik.com Git - wxWidgets.git/commitdiff
fix another minor bug in DLGC_WANTMESSAGE handling in MSWProcessMessage()
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Nov 2007 17:32:47 +0000 (17:32 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 13 Nov 2007 17:32:47 +0000 (17:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index f6e982303e365e63ba141e1a7b735964a927b27b..dbf35ef99914561611aa03b9050113d4f18cc513 100644 (file)
@@ -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