From 25fe875df65f98e7d1af0928995a615fb5559c91 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 9 Dec 2011 15:20:55 +0000 Subject: [PATCH] Restore mouse capturing/releasing in wxPopupTransientWindow under MSW. 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 | 7 +++---- src/common/popupcmn.cpp | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/wx/popupwin.h b/include/wx/popupwin.h index a4438261d4..9276cd7e02 100644 --- a/include/wx/popupwin.h +++ b/include/wx/popupwin.h @@ -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 diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index bf9c45aa06..4d94eaa688 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -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(); -- 2.45.2