diff --git a/src/Makefile.am b/src/Makefile.am index 10700017e..bba698df3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,8 +15,6 @@ mutter_SOURCES= \ core/bell.h \ core/boxes.c \ include/boxes.h \ - compositor/compositor.c \ - compositor/compositor-private.h \ compositor/compositor-mutter.c \ compositor/mutter-module.c \ compositor/mutter-module.h \ diff --git a/src/compositor/compositor-mutter.c b/src/compositor/compositor-mutter.c index 3c937aa42..08bad9b3d 100644 --- a/src/compositor/compositor-mutter.c +++ b/src/compositor/compositor-mutter.c @@ -17,7 +17,7 @@ #include "frame.h" #include "errors.h" #include "window.h" -#include "compositor-private.h" +#include "compositor.h" #include "compositor-mutter.h" #include "mutter-plugin-manager.h" #include "tidy/tidy-texture-frame.h" @@ -119,7 +119,6 @@ composite_at_least_version (MetaDisplay *display, int maj, int min) typedef struct _Mutter { - MetaCompositor compositor; MetaDisplay *display; Atom atom_x_root_pixmap; @@ -1138,8 +1137,8 @@ mutter_window_effect_completed (MutterWindow *cw, gulong event) } -static void -clutter_cmp_destroy (MetaCompositor *compositor) +void +meta_compositor_destroy (MetaCompositor *compositor) { } @@ -1845,9 +1844,9 @@ mutter_empty_stage_input_region (MetaScreen *screen) mutter_set_stage_input_region (screen, region); } -static void -clutter_cmp_manage_screen (MetaCompositor *compositor, - MetaScreen *screen) +void +meta_compositor_manage_screen (MetaCompositor *compositor, + MetaScreen *screen) { MetaCompScreen *info; MetaDisplay *display = meta_screen_get_display (screen); @@ -1968,15 +1967,15 @@ clutter_cmp_manage_screen (MetaCompositor *compositor, clutter_actor_show (info->stage); } -static void -clutter_cmp_unmanage_screen (MetaCompositor *compositor, - MetaScreen *screen) +void +meta_compositor_unmanage_screen (MetaCompositor *compositor, + MetaScreen *screen) { } -static void -clutter_cmp_add_window (MetaCompositor *compositor, - MetaWindow *window) +void +meta_compositor_add_window (MetaCompositor *compositor, + MetaWindow *window) { MetaScreen *screen = meta_window_get_screen (window); MetaDisplay *display = meta_screen_get_display (screen); @@ -1989,9 +1988,9 @@ clutter_cmp_add_window (MetaCompositor *compositor, meta_error_trap_pop (display, FALSE); } -static void -clutter_cmp_remove_window (MetaCompositor *compositor, - MetaWindow *window) +void +meta_compositor_remove_window (MetaCompositor *compositor, + MetaWindow *window) { MutterWindow *cw = NULL; @@ -2003,17 +2002,17 @@ clutter_cmp_remove_window (MetaCompositor *compositor, destroy_win (cw); } -static void -clutter_cmp_set_updates (MetaCompositor *compositor, - MetaWindow *window, - gboolean update) +void +meta_compositor_set_updates (MetaCompositor *compositor, + MetaWindow *window, + gboolean updates) { } -static gboolean -clutter_cmp_process_event (MetaCompositor *compositor, - XEvent *event, - MetaWindow *window) +gboolean +meta_compositor_process_event (MetaCompositor *compositor, + XEvent *event, + MetaWindow *window) { Mutter *xrc = (Mutter *) compositor; @@ -2099,22 +2098,47 @@ clutter_cmp_process_event (MetaCompositor *compositor, return FALSE; } -static Pixmap -clutter_cmp_get_window_pixmap (MetaCompositor *compositor, - MetaWindow *window) +Pixmap +meta_compositor_get_window_pixmap (MetaCompositor *compositor, + MetaWindow *window) { return None; } -static void -clutter_cmp_set_active_window (MetaCompositor *compositor, - MetaScreen *screen, - MetaWindow *window) +void +meta_compositor_set_active_window (MetaCompositor *compositor, + MetaScreen *screen, + MetaWindow *window) { } -static void -clutter_cmp_map_window (MetaCompositor *compositor, MetaWindow *window) +/* These functions are unused at the moment */ +void +meta_compositor_begin_move (MetaCompositor *compositor, + MetaWindow *window, + MetaRectangle *initial, + int grab_x, + int grab_y) +{ +} + +void +meta_compositor_update_move (MetaCompositor *compositor, + MetaWindow *window, + int x, + int y) +{ +} + +void +meta_compositor_end_move (MetaCompositor *compositor, + MetaWindow *window) +{ +} + +void +meta_compositor_map_window (MetaCompositor *compositor, + MetaWindow *window) { MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); DEBUG_TRACE ("clutter_cmp_map_window\n"); @@ -2124,8 +2148,9 @@ clutter_cmp_map_window (MetaCompositor *compositor, MetaWindow *window) map_win (cw); } -static void -clutter_cmp_unmap_window (MetaCompositor *compositor, MetaWindow *window) +void +meta_compositor_unmap_window (MetaCompositor *compositor, + MetaWindow *window) { MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); DEBUG_TRACE ("clutter_cmp_unmap_window\n"); @@ -2135,11 +2160,11 @@ clutter_cmp_unmap_window (MetaCompositor *compositor, MetaWindow *window) unmap_win (cw); } -static void -clutter_cmp_minimize_window (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect, - MetaRectangle *icon_rect) +void +meta_compositor_minimize_window (MetaCompositor *compositor, + MetaWindow *window, + MetaRectangle *window_rect, + MetaRectangle *icon_rect) { MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); @@ -2168,11 +2193,11 @@ clutter_cmp_minimize_window (MetaCompositor *compositor, } } -static void -clutter_cmp_unminimize_window (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect, - MetaRectangle *icon_rect) +void +meta_compositor_unminimize_window (MetaCompositor *compositor, + MetaWindow *window, + MetaRectangle *window_rect, + MetaRectangle *icon_rect) { #if 0 MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); @@ -2209,10 +2234,10 @@ clutter_cmp_unminimize_window (MetaCompositor *compositor, } -static void -clutter_cmp_maximize_window (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *rect) +void +meta_compositor_maximize_window (MetaCompositor *compositor, + MetaWindow *window, + MetaRectangle *window_rect) { MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); @@ -2230,17 +2255,17 @@ clutter_cmp_maximize_window (MetaCompositor *compositor, !mutter_plugin_manager_event_maximize (info->plugin_mgr, cw, MUTTER_PLUGIN_MAXIMIZE, - rect->x, rect->y, - rect->width, rect->height)) + window_rect->x, window_rect->y, + window_rect->width, window_rect->height)) { cw->priv->maximize_in_progress--; } } -static void -clutter_cmp_unmaximize_window (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *rect) +void +meta_compositor_unmaximize_window (MetaCompositor *compositor, + MetaWindow *window, + MetaRectangle *window_rect) { MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); @@ -2258,16 +2283,16 @@ clutter_cmp_unmaximize_window (MetaCompositor *compositor, !mutter_plugin_manager_event_maximize (info->plugin_mgr, cw, MUTTER_PLUGIN_UNMAXIMIZE, - rect->x, rect->y, - rect->width, rect->height)) + window_rect->x, window_rect->y, + window_rect->width, window_rect->height)) { cw->priv->unmaximize_in_progress--; } } -static void -clutter_cmp_update_workspace_geometry (MetaCompositor *compositor, - MetaWorkspace *workspace) +void +meta_compositor_update_workspace_geometry (MetaCompositor *compositor, + MetaWorkspace *workspace) { #if 0 /* FIXME -- should do away with this function in favour of MetaWorkspace @@ -2288,12 +2313,12 @@ clutter_cmp_update_workspace_geometry (MetaCompositor *compositor, #endif } -static void -clutter_cmp_switch_workspace (MetaCompositor *compositor, - MetaScreen *screen, - MetaWorkspace *from, - MetaWorkspace *to, - MetaMotionDirection direction) +void +meta_compositor_switch_workspace (MetaCompositor *compositor, + MetaScreen *screen, + MetaWorkspace *from, + MetaWorkspace *to, + MetaMotionDirection direction) { MetaCompScreen *info; gint to_indx, from_indx; @@ -2382,10 +2407,10 @@ sync_actor_stacking (GList *windows) } } -static void -clutter_cmp_sync_stack (MetaCompositor *compositor, - MetaScreen *screen, - GList *stack) +void +meta_compositor_sync_stack (MetaCompositor *compositor, + MetaScreen *screen, + GList *stack) { GList *old_stack; MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -2471,11 +2496,11 @@ clutter_cmp_sync_stack (MetaCompositor *compositor, sync_actor_stacking (info->windows); } -static void -clutter_cmp_set_window_hidden (MetaCompositor *compositor, - MetaScreen *screen, - MetaWindow *window, - gboolean hidden) +void +meta_compositor_set_window_hidden (MetaCompositor *compositor, + MetaScreen *screen, + MetaWindow *window, + gboolean hidden) { MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MutterWindowPrivate *priv = cw->priv; @@ -2509,9 +2534,9 @@ clutter_cmp_set_window_hidden (MetaCompositor *compositor, } } -static void -clutter_cmp_sync_window_geometry (MetaCompositor *compositor, - MetaWindow *window) +void +meta_compositor_sync_window_geometry (MetaCompositor *compositor, + MetaWindow *window) { MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); @@ -2526,11 +2551,11 @@ clutter_cmp_sync_window_geometry (MetaCompositor *compositor, sync_actor_position (cw); } -static void -clutter_cmp_sync_screen_size (MetaCompositor *compositor, - MetaScreen *screen, - guint width, - guint height) +void +meta_compositor_sync_screen_size (MetaCompositor *compositor, + MetaScreen *screen, + guint width, + guint height) { MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -2544,32 +2569,8 @@ clutter_cmp_sync_screen_size (MetaCompositor *compositor, width, height); } -static MetaCompositor comp_info = { - clutter_cmp_destroy, - clutter_cmp_manage_screen, - clutter_cmp_unmanage_screen, - clutter_cmp_add_window, - clutter_cmp_remove_window, - clutter_cmp_set_updates, - clutter_cmp_process_event, - clutter_cmp_get_window_pixmap, - clutter_cmp_set_active_window, - clutter_cmp_map_window, - clutter_cmp_unmap_window, - clutter_cmp_minimize_window, - clutter_cmp_unminimize_window, - clutter_cmp_maximize_window, - clutter_cmp_unmaximize_window, - clutter_cmp_update_workspace_geometry, - clutter_cmp_switch_workspace, - clutter_cmp_sync_stack, - clutter_cmp_set_window_hidden, - clutter_cmp_sync_window_geometry, - clutter_cmp_sync_screen_size -}; - MetaCompositor * -mutter_new (MetaDisplay *display) +meta_compositor_new (MetaDisplay *display) { char *atom_names[] = { "_XROOTPMAP_ID", @@ -2586,7 +2587,6 @@ mutter_new (MetaDisplay *display) return NULL; clc = g_new0 (Mutter, 1); - clc->compositor = comp_info; compositor = (MetaCompositor *) clc; diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h deleted file mode 100644 index f7fc1afbe..000000000 --- a/src/compositor/compositor-private.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - -/* - * Copyright (C) 2008 Iain Holmes - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef META_COMPOSITOR_PRIVATE_H -#define META_COMPOSITOR_PRIVATE_H - -#include "compositor.h" - -struct _MetaCompositor -{ - void (* destroy) (MetaCompositor *compositor); - - void (*manage_screen) (MetaCompositor *compositor, - MetaScreen *screen); - void (*unmanage_screen) (MetaCompositor *compositor, - MetaScreen *screen); - void (*add_window) (MetaCompositor *compositor, - MetaWindow *window); - void (*remove_window) (MetaCompositor *compositor, - MetaWindow *window); - void (*set_updates) (MetaCompositor *compositor, - MetaWindow *window, - gboolean update); - gboolean (*process_event) (MetaCompositor *compositor, - XEvent *event, - MetaWindow *window); - Pixmap (*get_window_pixmap) (MetaCompositor *compositor, - MetaWindow *window); - void (*set_active_window) (MetaCompositor *compositor, - MetaScreen *screen, - MetaWindow *window); - void (*map_window) (MetaCompositor *compositor, - MetaWindow *window); - void (*unmap_window) (MetaCompositor *compositor, - MetaWindow *window); - void (*minimize_window) (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect, - MetaRectangle *icon_rect); - void (*unminimize_window) (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect, - MetaRectangle *icon_rect); - void (*maximize_window) (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect); - void (*unmaximize_window) (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect); - void (*update_workspace_geometry) (MetaCompositor *compositor, - MetaWorkspace *workspace); - void (*switch_workspace) (MetaCompositor *compositor, - MetaScreen *screen, - MetaWorkspace *from, - MetaWorkspace *to, - MetaMotionDirection direction); - void (*sync_stack) (MetaCompositor *compositor, - MetaScreen *screen, - GList *stack); - void (*set_window_hidden) (MetaCompositor *compositor, - MetaScreen *screen, - MetaWindow *window, - gboolean hidden); - void (*sync_window_geometry) (MetaCompositor *compositor, - MetaWindow *window); - void (*sync_screen_size) (MetaCompositor *compositor, - MetaScreen *screen, - guint width, - guint height); -}; - -#endif diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c deleted file mode 100644 index 3890ee8cb..000000000 --- a/src/compositor/compositor.c +++ /dev/null @@ -1,240 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - -/* - * Copyright (C) 2008 Iain Holmes - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#include -#include "compositor-private.h" -#include "compositor-mutter.h" -#include "prefs.h" - -MetaCompositor * -meta_compositor_new (MetaDisplay *display) -{ - return mutter_new (display); -} - -void -meta_compositor_destroy (MetaCompositor *compositor) -{ - if (compositor && compositor->destroy) - compositor->destroy (compositor); -} - -void -meta_compositor_add_window (MetaCompositor *compositor, - MetaWindow *window) -{ - if (compositor && compositor->add_window) - compositor->add_window (compositor, window); -} - -void -meta_compositor_remove_window (MetaCompositor *compositor, - MetaWindow *window) -{ - if (compositor && compositor->remove_window) - compositor->remove_window (compositor, window); -} - -void -meta_compositor_manage_screen (MetaCompositor *compositor, - MetaScreen *screen) -{ - if (compositor && compositor->manage_screen) - compositor->manage_screen (compositor, screen); -} - -void -meta_compositor_unmanage_screen (MetaCompositor *compositor, - MetaScreen *screen) -{ - if (compositor && compositor->unmanage_screen) - compositor->unmanage_screen (compositor, screen); -} - -void -meta_compositor_set_updates (MetaCompositor *compositor, - MetaWindow *window, - gboolean updates) -{ - if (compositor && compositor->set_updates) - compositor->set_updates (compositor, window, updates); -} - -gboolean -meta_compositor_process_event (MetaCompositor *compositor, - XEvent *event, - MetaWindow *window) -{ - if (compositor && compositor->process_event) - return compositor->process_event (compositor, event, window); - else - return FALSE; -} - -Pixmap -meta_compositor_get_window_pixmap (MetaCompositor *compositor, - MetaWindow *window) -{ - if (compositor && compositor->get_window_pixmap) - return compositor->get_window_pixmap (compositor, window); - else - return None; -} - -void -meta_compositor_set_active_window (MetaCompositor *compositor, - MetaScreen *screen, - MetaWindow *window) -{ - if (compositor && compositor->set_active_window) - compositor->set_active_window (compositor, screen, window); -} - -/* These functions are unused at the moment */ -void meta_compositor_begin_move (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *initial, - int grab_x, - int grab_y) -{ -} - -void meta_compositor_update_move (MetaCompositor *compositor, - MetaWindow *window, - int x, - int y) -{ -} - -void meta_compositor_end_move (MetaCompositor *compositor, - MetaWindow *window) -{ -} - -void -meta_compositor_map_window (MetaCompositor *compositor, - MetaWindow *window) -{ - if (compositor && compositor->map_window) - compositor->map_window (compositor, window); -} - -void -meta_compositor_unmap_window (MetaCompositor *compositor, - MetaWindow *window) -{ - if (compositor && compositor->unmap_window) - compositor->unmap_window (compositor, window); -} - -void -meta_compositor_minimize_window (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect, - MetaRectangle *icon_rect) -{ - if (compositor && compositor->minimize_window) - compositor->minimize_window (compositor, window, window_rect, icon_rect); -} - -void -meta_compositor_unminimize_window (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect, - MetaRectangle *icon_rect) -{ - if (compositor && compositor->unminimize_window) - compositor->unminimize_window (compositor, window, window_rect, icon_rect); -} - -void -meta_compositor_maximize_window (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect) -{ - if (compositor && compositor->maximize_window) - compositor->maximize_window (compositor, window, window_rect); -} - -void -meta_compositor_unmaximize_window (MetaCompositor *compositor, - MetaWindow *window, - MetaRectangle *window_rect) -{ - if (compositor && compositor->unmaximize_window) - compositor->unmaximize_window (compositor, window, window_rect); -} - -void -meta_compositor_update_workspace_geometry (MetaCompositor *compositor, - MetaWorkspace *workspace) -{ - if (compositor && compositor->update_workspace_geometry) - compositor->update_workspace_geometry (compositor, workspace); -} - -void -meta_compositor_switch_workspace (MetaCompositor *compositor, - MetaScreen *screen, - MetaWorkspace *from, - MetaWorkspace *to, - MetaMotionDirection direction) -{ - if (compositor && compositor->switch_workspace) - compositor->switch_workspace (compositor, screen, from, to, direction); -} - -void -meta_compositor_sync_stack (MetaCompositor *compositor, - MetaScreen *screen, - GList *stack) -{ - if (compositor && compositor->sync_stack) - compositor->sync_stack (compositor, screen, stack); -} - -void -meta_compositor_set_window_hidden (MetaCompositor *compositor, - MetaScreen *screen, - MetaWindow *window, - gboolean hidden) -{ - if (compositor && compositor->set_window_hidden) - compositor->set_window_hidden (compositor, screen, window, hidden); -} - -void -meta_compositor_sync_window_geometry (MetaCompositor *compositor, - MetaWindow *window) -{ - if (compositor && compositor->sync_window_geometry) - compositor->sync_window_geometry (compositor, window); -} - -void -meta_compositor_sync_screen_size (MetaCompositor *compositor, - MetaScreen *screen, - guint width, - guint height) -{ - if (compositor && compositor->sync_screen_size) - compositor->sync_screen_size (compositor, screen, width, height); -} diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c index 1c6cdcad0..73f96c2d9 100644 --- a/src/core/stack-tracker.c +++ b/src/core/stack-tracker.c @@ -686,9 +686,10 @@ meta_stack_tracker_sync_stack (MetaStackTracker *tracker) meta_windows = g_list_prepend (meta_windows, meta_window); } - meta_compositor_sync_stack (tracker->screen->display->compositor, - tracker->screen, - meta_windows); + if (tracker->screen->display->compositor) + meta_compositor_sync_stack (tracker->screen->display->compositor, + tracker->screen, + meta_windows); g_list_free (meta_windows); meta_screen_restacked (tracker->screen); diff --git a/src/core/window.c b/src/core/window.c index b1c261e8a..c1e464a3f 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1274,8 +1274,9 @@ meta_window_unmanage (MetaWindow *window, if (window->display->focus_window == window) { window->display->focus_window = NULL; - meta_compositor_set_active_window (window->display->compositor, - window->screen, NULL); + if (window->display->compositor) + meta_compositor_set_active_window (window->display->compositor, + window->screen, NULL); } if (window->maximized_horizontally || window->maximized_vertically) @@ -2550,10 +2551,11 @@ meta_window_show (MetaWindow *window) meta_stack_freeze (window->screen->stack); window->hidden = FALSE; /* Inform the compositor that the window isn't hidden */ - meta_compositor_set_window_hidden (window->display->compositor, - window->screen, - window, - window->hidden); + if (window->display->compositor) + meta_compositor_set_window_hidden (window->display->compositor, + window->screen, + window, + window->hidden); meta_stack_thaw (window->screen->stack); did_show = TRUE; } @@ -2582,8 +2584,11 @@ meta_window_show (MetaWindow *window) NULL, NULL); } else - meta_compositor_map_window (window->display->compositor, - window); + { + if (window->display->compositor) + meta_compositor_map_window (window->display->compositor, + window); + } window->was_minimized = FALSE; } @@ -2659,21 +2664,24 @@ meta_window_hide (MetaWindow *window) meta_stack_freeze (window->screen->stack); window->hidden = TRUE; /* Tell the compositor this window is now hidden */ - meta_compositor_set_window_hidden (window->display->compositor, - window->screen, - window, - window->hidden); + if (window->display->compositor) + meta_compositor_set_window_hidden (window->display->compositor, + window->screen, + window, + window->hidden); meta_stack_thaw (window->screen->stack); - meta_compositor_unmap_window (window->display->compositor, - window); + if (window->display->compositor) + meta_compositor_unmap_window (window->display->compositor, + window); did_hide = TRUE; } else { - meta_compositor_unmap_window (window->display->compositor, - window); + if (window->display->compositor) + meta_compositor_unmap_window (window->display->compositor, + window); /* Unmapping the frame is enough to make the window disappear, * but we need to hide the window itself so the client knows @@ -4019,8 +4027,9 @@ meta_window_move_resize_internal (MetaWindow *window, newx, newy, window->rect.width, window->rect.height, window->user_rect.x, window->user_rect.y, window->user_rect.width, window->user_rect.height); - meta_compositor_sync_window_geometry (window->display->compositor, - window); + if (window->display->compositor) + meta_compositor_sync_window_geometry (window->display->compositor, + window); } else { @@ -4188,7 +4197,8 @@ meta_window_configure_notify (MetaWindow *window, XConfigureEvent *event) if (!event->override_redirect && !event->send_event) meta_warning ("Unhandled change of windows override redirect status\n"); - meta_compositor_sync_window_geometry (window->display->compositor, window); + if (window->display->compositor) + meta_compositor_sync_window_geometry (window->display->compositor, window); } void @@ -5817,8 +5827,9 @@ meta_window_notify_focus (MetaWindow *window, "* Focus --> %s\n", window->desc); window->display->focus_window = window; window->has_focus = TRUE; - meta_compositor_set_active_window (window->display->compositor, - window->screen, window); + if (window->display->compositor) + meta_compositor_set_active_window (window->display->compositor, + window->screen, window); /* Move to the front of the focusing workspace's MRU list. * We should only be "removing" it from the MRU list if it's @@ -5906,8 +5917,9 @@ meta_window_notify_focus (MetaWindow *window, if (window->frame) meta_frame_queue_draw (window->frame); - meta_compositor_set_active_window (window->display->compositor, - window->screen, NULL); + if (window->display->compositor) + meta_compositor_set_active_window (window->display->compositor, + window->screen, NULL); meta_error_trap_push (window->display); XUninstallColormap (window->display->xdisplay, diff --git a/src/core/workspace.c b/src/core/workspace.c index 0deaf69b8..d13735f98 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -540,6 +540,9 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace, gint num_workspaces, current_space, new_space; MetaMotionDirection direction = 0; + if (!comp) + return; + current_space = meta_workspace_index (old); new_space = meta_workspace_index (workspace); @@ -922,14 +925,17 @@ ensure_work_areas_validated (MetaWorkspace *workspace) /* We're all done, YAAY! Record that everything has been validated. */ workspace->work_areas_invalid = FALSE; - /* - * Notify the compositor that the workspace geometry has changed. - */ - MetaScreen *screen = workspace->screen; - MetaDisplay *display = meta_screen_get_display (screen); - MetaCompositor *comp = meta_display_get_compositor (display); + { + /* + * Notify the compositor that the workspace geometry has changed. + */ + MetaScreen *screen = workspace->screen; + MetaDisplay *display = meta_screen_get_display (screen); + MetaCompositor *comp = meta_display_get_compositor (display); - meta_compositor_update_workspace_geometry (comp, workspace); + if (comp) + meta_compositor_update_workspace_geometry (comp, workspace); + } } /**