Handle compositor being disabled and don't crash.

2008-03-19  Iain Holmes  <iain@gnome.org>

        * src/core/compositor.c (meta_compositor_set_active_window): 
Handle
        compositor being disabled and don't crash.


svn path=/trunk/; revision=3655
This commit is contained in:
Iain Holmes 2008-03-19 11:51:10 +00:00 committed by Iain Holmes
parent f2b400b82c
commit 915192ca9f
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2008-03-19 Iain Holmes <iain@gnome.org>
* src/core/compositor.c (meta_compositor_set_active_window): Handle
compositor being disabled and don't crash.
2008-03-19 Iain Holmes <iain@gnome.org> 2008-03-19 Iain Holmes <iain@gnome.org>
* src/core/compositor.c (meta_compositor_set_active_window): Add a * src/core/compositor.c (meta_compositor_set_active_window): Add a

View File

@ -2744,11 +2744,19 @@ meta_compositor_set_active_window (MetaCompositor *compositor,
MetaWindow *window) MetaWindow *window)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaDisplay *display = compositor->display; MetaDisplay *display;
Display *xdisplay = display->xdisplay; Display *xdisplay;
MetaCompWindow *old_focus = NULL, *new_focus = NULL; MetaCompWindow *old_focus = NULL, *new_focus = NULL;
MetaCompScreen *info = screen->compositor_data; MetaCompScreen *info;
MetaWindow *old_focus_win = info->focus_window; MetaWindow *old_focus_win;
if (compositor == NULL)
return;
display = compositor->display;
xdisplay = display->xdisplay;
info = screen->compositor_data;
old_focus_win = info->focus_window;
if (old_focus_win) if (old_focus_win)
{ {