From: Dana Jansens Date: Wed, 1 May 2002 07:13:12 +0000 (+0000) Subject: fix possible seg because of new move code. make sure that the masked_window pointer... X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=5f9c458fbc5fff1fdde65981084b658fcde5eabc;p=chaz%2Fopenbox fix possible seg because of new move code. make sure that the masked_window pointer gets cleanup up (call endMove) when a window is destroyed (pointer is then invalid) --- diff --git a/src/Window.cc b/src/Window.cc index f722902a..431d3167 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -2283,6 +2283,9 @@ void OpenboxWindow::unmapNotifyEvent(XUnmapEvent *ue) { openbox.grab(); if (! validateClient()) return; + if (flags.moving) + endMove(); + XChangeSaveSet(display, client.window, SetModeDelete); XSelectInput(display, client.window, NoEventMask); @@ -2318,6 +2321,8 @@ void OpenboxWindow::unmapNotifyEvent(XUnmapEvent *ue) { void OpenboxWindow::destroyNotifyEvent(XDestroyWindowEvent *de) { if (de->window == client.window) { + if (flags.moving) + endMove(); XUnmapWindow(display, frame.window); delete this; @@ -2754,9 +2759,8 @@ void OpenboxWindow::startMove(int x, int y) { ASSERT(!flags.moving); // make sure only one window is moving at a time - OpenboxWindow *w; - if ((w = openbox.getMaskedWindow()) != (OpenboxWindow *) 0 && - w->flags.moving) + OpenboxWindow *w = openbox.getMaskedWindow(); + if (w != (OpenboxWindow *) 0 && w->flags.moving) w->endMove(); XGrabPointer(display, frame.window, False, PointerMotionMask |