From 61e686649bece99461853f4b55f9dc91a442752d Mon Sep 17 00:00:00 2001 From: twanvl Date: Tue, 7 Dec 2010 21:45:27 +0000 Subject: [PATCH] attempt to deal with mouse capture in DropDownList, still not entirely correct! git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1557 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/drop_down_list.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/drop_down_list.cpp b/src/gui/drop_down_list.cpp index 3db4a9ea..ea155c7d 100644 --- a/src/gui/drop_down_list.cpp +++ b/src/gui/drop_down_list.cpp @@ -109,14 +109,15 @@ void DropDownList::show(bool in_place, wxPoint pos, RealRect* rect) { visible_start = 0; ensureSelectedItemVisible(); // show + if (GetParent()->HasCapture()) { + // release capture on parent + // do this before showing the popup, because that might change who has the capture + GetParent()->ReleaseMouse(); + } if (selected_item == NO_SELECTION && itemCount() > 0) selected_item = 0; // select first item by default mouse_down = false; close_on_mouse_out = false; Popup(); - if (isRoot() && GetParent()->HasCapture()) { - // release capture on parent - GetParent()->ReleaseMouse(); - } // fix drop down arrow redrawArrowOnParent(); }