]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
somehow log target wasn't being created automatically anymore. Restored.
[wxWidgets.git] / src / msw / window.cpp
index 490d7d03273b887bbc3c55a6de9949238c4400b0..db9a0969bd6c9be79ccb8ec986405d19d4fe5f8d 100644 (file)
@@ -1924,7 +1924,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
 
     // WM_GETDLGCODE: if the control wants it for itself, don't process it
     // (except for Ctrl-Tab combination which is always processed)
-    LONG lDlgCode;
+    LONG lDlgCode = 0;
     if ( bProcess && !bCtrlDown ) {
       lDlgCode = ::SendMessage(msg->hwnd, WM_GETDLGCODE, 0, 0);
     }
@@ -1933,7 +1933,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
     if ( bProcess ) {
       switch ( msg->wParam ) {
         case VK_TAB:
-          if ( lDlgCode & DLGC_WANTTAB )
+          if ( lDlgCode & DLGC_WANTTAB )  // this is FALSE for Ctrl-Tab
             bProcess = FALSE;
           else
             bForward = !(::GetKeyState(VK_SHIFT) & 0x100);
@@ -4381,7 +4381,18 @@ void wxWindow::OnIdle(wxIdleEvent& event)
         {
             // Generate a LEAVE event
             m_mouseInWindow = FALSE;
-            MSWOnMouseLeave(pt.x, pt.y, 0);
+
+            int state;
+            if (::GetKeyState(VK_SHIFT) != 0)
+                state |= MK_SHIFT;
+            if (::GetKeyState(VK_CONTROL) != 0)
+                state |= MK_CONTROL;
+
+            // Unfortunately the mouse button and keyboard state may have changed
+            // by the time the OnIdle function is called, so 'state' may be
+            // meaningless.
+
+            MSWOnMouseLeave(pt.x, pt.y, state);
         }
     }
     UpdateWindowUI();