1
0
Fork 0

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
This commit is contained in:
Thomas Thurman 2008-07-14 00:41:25 +00:00 committed by Thomas James Alexander Thurman
parent dacf784498
commit 34fe81fabd
2 changed files with 23 additions and 9 deletions

View file

@ -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

View file

@ -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));
}
}