summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2008-07-14 00:41:25 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2008-07-14 00:41:25 +0000
commit34fe81fabdb9aa06848a0179b00f5d61420d22e7 (patch)
tree064bac6562c8190a515e22f14b8005200955b2e1
parentdacf78449883f554541dedfc170c4ab8e83b7afe (diff)
downloadmetacity-34fe81fabdb9aa06848a0179b00f5d61420d22e7.tar.gz
meta_display_screen_for_root() can return NULL, so check for that. Fixes
2008-07-13 Thomas Thurman <tthurman@gnome.org> * src/core/display.c (event_callback): meta_display_screen_for_root() can return NULL, so check for that. Fixes #422242. Also tidying. svn path=/trunk/; revision=3788
-rw-r--r--ChangeLog5
-rw-r--r--src/core/display.c27
2 files changed, 23 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a2b44024..b84d888d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-13 Thomas Thurman <tthurman@gnome.org>
+
+ * src/core/display.c (event_callback): meta_display_screen_for_root()
+ can return NULL, so check for that. Fixes #422242. Also tidying.
+
2008-07-13 Elijah Newren <newren gmail com>
* src/core/workspace.c (meta_workspace_free): Don't attempt to
diff --git a/src/core/display.c b/src/core/display.c
index 613230ff..d6c44d10 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1910,11 +1910,13 @@ event_callback (XEvent *event,
meta_event_mode_to_string (event->xfocus.mode),
meta_event_detail_to_string (event->xfocus.detail));
}
- else if (meta_display_screen_for_root (display,
- event->xany.window) != NULL)
+ else
{
- MetaScreen * screen;
- screen = meta_display_screen_for_root (display, event->xany.window);
+ MetaScreen *screen =
+ meta_display_screen_for_root(display,
+ event->xany.window);
+ if (screen == NULL)
+ break;
meta_topic (META_DEBUG_FOCUS,
"Focus %s event received on root window 0x%lx "
@@ -1930,17 +1932,24 @@ event_callback (XEvent *event,
event->xfocus.detail == NotifyDetailNone)
{
meta_topic (META_DEBUG_FOCUS,
- "Focus got set to None, probably due to brain-damage in the X protocol (see bug 125492). Setting the default focus window.\n");
-
- meta_workspace_focus_default_window (screen->active_workspace, NULL, meta_display_get_current_time_roundtrip (display));
+ "Focus got set to None, probably due to "
+ "brain-damage in the X protocol (see bug "
+ "125492). Setting the default focus window.\n");
+ meta_workspace_focus_default_window (screen->active_workspace,
+ NULL,
+ meta_display_get_current_time_roundtrip (display));
}
else if (event->type == FocusIn &&
event->xfocus.mode == NotifyNormal &&
event->xfocus.detail == NotifyInferior)
{
meta_topic (META_DEBUG_FOCUS,
- "Focus got set to root window, probably due to gnome-session logout dialog usage (see bug 153220). Setting the default focus window.\n");
- meta_workspace_focus_default_window (screen->active_workspace, NULL, meta_display_get_current_time_roundtrip (display));
+ "Focus got set to root window, probably due to "
+ "gnome-session logout dialog usage (see bug "
+ "153220). Setting the default focus window.\n");
+ meta_workspace_focus_default_window (screen->active_workspace,
+ NULL,
+ meta_display_get_current_time_roundtrip (display));
}
}