From f3ade45b967c10b075b36c2785cbb0a9ee431a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Sandmann?= Date: Fri, 17 Feb 2006 16:58:08 +0000 Subject: [PATCH] Only uncomposite the screen if there is a compositor. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fri Feb 17 11:56:35 2006 Søren Sandmann * src/screen.c (meta_screen_free): Only uncomposite the screen if there is a compositor. * src/compositor.c (meta_compositor_new): Warn and fail if the server doesn't have composite --- ChangeLog | 8 ++++++++ src/compositor.c | 22 +++++++++++++++++++++- src/screen.c | 7 +++++-- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e33858bb8..3d6903b78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Fri Feb 17 11:56:35 2006 Søren Sandmann + + * src/screen.c (meta_screen_free): Only uncomposite the screen if + there is a compositor. + + * src/compositor.c (meta_compositor_new): Warn and fail if the + server doesn't have composite + Thu Feb 16 18:57:48 2006 Søren Sandmann * src/compositor.c: Fix the build when --enable-compositor is diff --git a/src/compositor.c b/src/compositor.c index 1c40902e6..921e28134 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -101,7 +101,27 @@ meta_compositor_new (MetaDisplay *display) compositor = g_new0 (MetaCompositor, 1); if (!compositor_display) - compositor_display = ws_display_new (NULL); + { + gboolean has_extensions; + + compositor_display = ws_display_new (NULL); + + has_extensions = + ws_display_init_composite (compositor_display) && + ws_display_init_damage (compositor_display) && + ws_display_init_fixes (compositor_display) && + ws_display_init_test (compositor_display); + + if (!has_extensions) + { + g_warning ("Disabling compositor since the server is missing at " + "least one of the COMPOSITE, DAMAGE, FIXES or TEST " + "extensions"); + + return NULL; + } + } + compositor->display = compositor_display; ws_display_set_synchronize (compositor_display, diff --git a/src/screen.c b/src/screen.c index c7a99f07c..54bd591d7 100644 --- a/src/screen.c +++ b/src/screen.c @@ -665,8 +665,11 @@ meta_screen_free (MetaScreen *screen) meta_display_grab (display); - meta_compositor_unmanage_screen (screen->display->compositor, - screen); + if (screen->display->compositor) + { + meta_compositor_unmanage_screen (screen->display->compositor, + screen); + } meta_display_unmanage_windows_for_screen (display, screen);