From 8b061b2af92e71cf0992595a833034cc0a89c48f Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sun, 4 May 2003 12:27:46 +0000 Subject: [PATCH] Fix for the fact that unmapped but managed widgets intercept mouse events even if they are not visible. (backport) Set/reset MappedWhenManaged flag when showing/hiding a window, otherwise, since some common operations (moving, adding items to a listbox, ...) do a Unmanage-Manage pair, calling Hide and then (for example) SetSize would show the window again. (backport) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/motif/window.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 15a5f5240f..88d11a20ac 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -179,9 +179,22 @@ bool wxWindow::MapOrUnmap(WXWidget widget, bool map) return FALSE; if ( map ) + { + XtManageChild(w); XtMapWidget(w); + } else + { XtUnmapWidget(w); + XtUnmanageChild(w); + } + + // Rationale: a lot of common operations (including but not + // limited to moving, resizing and appending items to a listbox) + // unmamange the widget, do their work, then manage it again. + // This means that, for example adding an item to a listbox will show it, + // or that most controls are shown every time they are moved or resized! + XtSetMappedWhenManaged( w, map ); return TRUE; }