From af077ae1ac6ec99cc1e64bfd3b9f8dcd69301940 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 14 Apr 2003 23:40:41 +0000 Subject: mask event so we dont get unmap while reparent --- src/FbWinFrame.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index bfef355..a803680 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.17 2003/04/14 14:40:30 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.18 2003/04/14 23:40:41 fluxgen Exp $ #include "FbWinFrame.hh" #include "ImageControl.hh" @@ -270,18 +270,23 @@ void FbWinFrame::setClientWindow(Window win) { XSetWindowBorderWidth(display, win, 0); XChangeSaveSet(display, win, SetModeInsert); - XSetWindowAttributes attrib_set; - // sync old events so we can discard events from reparent later - XSync(display, False); + + + XSelectInput(display, m_clientarea.window(), NoEventMask); + // we need to mask this so we don't get unmap event + XSelectInput(display, win, NoEventMask); XReparentWindow(display, win, m_clientarea.window(), 0, 0); - XSync(display, True); // discard unmap notify event - // redirected events from client window + // remask window so we get events + XSelectInput(display, win, PropertyChangeMask | StructureNotifyMask | + FocusChangeMask ); XSelectInput(display, m_clientarea.window(), SubstructureRedirectMask); XFlush(display); + XSetWindowAttributes attrib_set; attrib_set.event_mask = PropertyChangeMask | StructureNotifyMask | FocusChangeMask; - attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | ButtonMotionMask; + attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask; XChangeWindowAttributes(display, win, CWEventMask|CWDontPropagate, &attrib_set); -- cgit v0.11.2