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)

This commit is contained in:
Dana Jansens 2002-05-01 07:13:12 +00:00
parent 0be1c1e8d7
commit 5f9c458fbc

View file

@ -2283,6 +2283,9 @@ void OpenboxWindow::unmapNotifyEvent(XUnmapEvent *ue) {
openbox.grab(); openbox.grab();
if (! validateClient()) return; if (! validateClient()) return;
if (flags.moving)
endMove();
XChangeSaveSet(display, client.window, SetModeDelete); XChangeSaveSet(display, client.window, SetModeDelete);
XSelectInput(display, client.window, NoEventMask); XSelectInput(display, client.window, NoEventMask);
@ -2318,6 +2321,8 @@ void OpenboxWindow::unmapNotifyEvent(XUnmapEvent *ue) {
void OpenboxWindow::destroyNotifyEvent(XDestroyWindowEvent *de) { void OpenboxWindow::destroyNotifyEvent(XDestroyWindowEvent *de) {
if (de->window == client.window) { if (de->window == client.window) {
if (flags.moving)
endMove();
XUnmapWindow(display, frame.window); XUnmapWindow(display, frame.window);
delete this; delete this;
@ -2754,9 +2759,8 @@ void OpenboxWindow::startMove(int x, int y) {
ASSERT(!flags.moving); ASSERT(!flags.moving);
// make sure only one window is moving at a time // make sure only one window is moving at a time
OpenboxWindow *w; OpenboxWindow *w = openbox.getMaskedWindow();
if ((w = openbox.getMaskedWindow()) != (OpenboxWindow *) 0 && if (w != (OpenboxWindow *) 0 && w->flags.moving)
w->flags.moving)
w->endMove(); w->endMove();
XGrabPointer(display, frame.window, False, PointerMotionMask | XGrabPointer(display, frame.window, False, PointerMotionMask |