summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCraig Black <blackc@speakeasy.net>2002-08-03 23:07:04 +0000
committerCraig Black <blackc@src.gnome.org>2002-08-03 23:07:04 +0000
commitdc5a81ac77e4d590ec53e21efba071ad808745d0 (patch)
treecf016fe4221e136cd280ff8ce57fc9f13e067bcd /src
parentb51e6bdaa44304fd84942bd261bc33778053430a (diff)
downloadmetacity-dc5a81ac77e4d590ec53e21efba071ad808745d0.tar.gz
metacity-dc5a81ac77e4d590ec53e21efba071ad808745d0.tar.bz2
Have ButtonPress and UnmapNotify events account for a null grab window,
2002-08-03 Craig Black <blackc@speakeasy.net> * src/display.c: (event_callback): Have ButtonPress and UnmapNotify events account for a null grab window, fixes #87896
Diffstat (limited to 'src')
-rw-r--r--src/display.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/src/display.c b/src/display.c
index fd4cfd4..2d72b7d 100644
--- a/src/display.c
+++ b/src/display.c
@@ -1030,7 +1030,8 @@ event_callback (XEvent *event,
meta_display_process_key_event (display, window, event);
break;
case ButtonPress:
- if ((grab_op_is_mouse (display->grab_op) &&
+ if ((window &&
+ grab_op_is_mouse (display->grab_op) &&
display->grab_button != (int) event->xbutton.button &&
display->grab_window == window) ||
grab_op_is_keyboard (display->grab_op))
@@ -1340,36 +1341,39 @@ event_callback (XEvent *event,
}
break;
case UnmapNotify:
- if (display->grab_op != META_GRAB_OP_NONE &&
- display->grab_window == window)
- meta_display_end_grab_op (display, CurrentTime);
-
- if (!frame_was_receiver && window)
+ if (window)
{
- if (window->unmaps_pending == 0)
- {
- meta_topic (META_DEBUG_WINDOW_STATE,
- "Window %s withdrawn\n",
- window->desc);
- window->withdrawn = TRUE;
- meta_window_free (window); /* Unmanage withdrawn window */
- window = NULL;
- }
- else
+ if (display->grab_op != META_GRAB_OP_NONE &&
+ display->grab_window == window)
+ meta_display_end_grab_op (display, CurrentTime);
+
+ if (!frame_was_receiver)
{
- window->unmaps_pending -= 1;
- meta_topic (META_DEBUG_WINDOW_STATE,
- "Received pending unmap, %d now pending\n",
- window->unmaps_pending);
+ if (window->unmaps_pending == 0)
+ {
+ meta_topic (META_DEBUG_WINDOW_STATE,
+ "Window %s withdrawn\n",
+ window->desc);
+ window->withdrawn = TRUE;
+ meta_window_free (window); /* Unmanage withdrawn window */
+ window = NULL;
+ }
+ else
+ {
+ window->unmaps_pending -= 1;
+ meta_topic (META_DEBUG_WINDOW_STATE,
+ "Received pending unmap, %d now pending\n",
+ window->unmaps_pending);
+ }
}
- }
- /* Unfocus on UnmapNotify, do this after the possible
- * window_free above so that window_free can see if window->has_focus
- * and move focus to another window
- */
- if (window)
- meta_window_notify_focus (window, event);
+ /* Unfocus on UnmapNotify, do this after the possible
+ * window_free above so that window_free can see if window->has_focus
+ * and move focus to another window
+ */
+ if (window)
+ meta_window_notify_focus (window, event);
+ }
break;
case MapNotify:
break;