]> git.saurik.com Git - wxWidgets.git/commitdiff
Restore mouse capturing/releasing in wxPopupTransientWindow under MSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 9 Dec 2011 15:20:55 +0000 (15:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 9 Dec 2011 15:20:55 +0000 (15:20 +0000)
Partially revert the changes of r69350 to restore EVT_IDLE handling of
wxPopupTransientWindow under MSW. It turns out that we must release the mouse
for the embedded controls to work.

It would be better to solve the problem differently, e.g. perhaps maybe only
releasing mouse capture when mouse is clicked as the current code is fragile
but for now at least restore the functionality that used to work.

Closes #13740.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/popupwin.h
src/common/popupcmn.cpp

index a4438261d4ad656c56b6efc4c203d091c0b3fb45..9276cd7e02b3427118417cafc978e7acd9160cf3 100644 (file)
@@ -132,10 +132,9 @@ protected:
     // get alerted when child gets deleted from under us
     void OnDestroy(wxWindowDestroyEvent& event);
 
-    // wxOSX/Carbon doesn't generate mouse capture loss events currently so
-    // poll for the capture loss ourselves.
-#if defined(__WXMAC__) && wxOSX_USE_CARBON
-    // check if the mouse needs captured or released
+#if defined(__WXMSW__) ||(defined(__WXMAC__) && wxOSX_USE_CARBON)
+    // Check if the mouse needs to be captured or released: we must release
+    // when it's inside our window if we want the embedded controls to work.
     void OnIdle(wxIdleEvent& event);
 #endif
 
index bf9c45aa06c294da754ed36fec5f5cd3bc1ca66f..4d94eaa688c34c72a666f192c066f5acff34c975 100644 (file)
@@ -116,7 +116,7 @@ BEGIN_EVENT_TABLE(wxPopupFocusHandler, wxEvtHandler)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxPopupTransientWindow, wxPopupWindow)
-#if defined(__WXMAC__) && wxOSX_USE_CARBON
+#if defined(__WXMSW__) ||(defined(__WXMAC__) && wxOSX_USE_CARBON)
     EVT_IDLE(wxPopupTransientWindow::OnIdle)
 #endif
 END_EVENT_TABLE()
@@ -426,7 +426,7 @@ bool wxPopupTransientWindow::ProcessLeftDown(wxMouseEvent& WXUNUSED(event))
     return false;
 }
 
-#if defined(__WXMAC__) && wxOSX_USE_CARBON
+#if defined(__WXMSW__) ||(defined(__WXMAC__) && wxOSX_USE_CARBON)
 void wxPopupTransientWindow::OnIdle(wxIdleEvent& event)
 {
     event.Skip();