From 03bbe3de171e61bc7b6cfa4beb364e2436b3a28e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 24 Nov 2003 23:00:52 +0000 Subject: [PATCH] fix the extension checks 2003-11-24 Havoc Pennington * src/compositor.c (meta_compositor_new): fix the extension checks --- ChangeLog | 4 ++++ src/Makefile.am | 2 ++ src/compositor.c | 21 ++++++++++++++++----- src/display.c | 16 +++++++++++++++- src/keybindings.c | 7 ++++++- src/main.c | 5 +++++ src/window.c | 3 +++ 7 files changed, 51 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc4b9a1a4..86b5edffd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-11-24 Havoc Pennington + + * src/compositor.c (meta_compositor_new): fix the extension checks + 2003-11-24 Havoc Pennington * src/iconcache.c (meta_icon_cache_init): init prev_mask field diff --git a/src/Makefile.am b/src/Makefile.am index 391a79d37..ffaecae7a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,6 +31,8 @@ metacity_SOURCES= \ errors.h \ eventqueue.c \ eventqueue.h \ + expocity.c \ + expocity.h \ fixedtip.c \ fixedtip.h \ frame.c \ diff --git a/src/compositor.c b/src/compositor.c index 2e8c087b5..d10ee77c6 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -84,6 +84,10 @@ struct MetaCompositor guint repair_idle; guint enabled : 1; + guint have_composite : 1; + guint have_damage : 1; + guint have_fixes : 1; + guint have_render : 1; }; #ifdef HAVE_COMPOSITE_EXTENSIONS @@ -123,8 +127,9 @@ meta_compositor_new (MetaDisplay *display) { compositor->composite_event_base = 0; compositor->composite_error_base = 0; - meta_verbose ("XCompositeQueryExtension() returned FALSE\n"); } + else + compositor->have_composite = TRUE; meta_verbose ("Composite extension event base %d error base %d\n", compositor->composite_event_base, @@ -137,6 +142,8 @@ meta_compositor_new (MetaDisplay *display) compositor->damage_event_base = 0; compositor->damage_error_base = 0; } + else + compositor->have_damage = TRUE; meta_verbose ("Damage extension event base %d error base %d\n", compositor->damage_event_base, @@ -149,6 +156,8 @@ meta_compositor_new (MetaDisplay *display) compositor->fixes_event_base = 0; compositor->fixes_error_base = 0; } + else + compositor->have_fixes = TRUE; meta_verbose ("Fixes extension event base %d error base %d\n", compositor->fixes_event_base, @@ -161,15 +170,17 @@ meta_compositor_new (MetaDisplay *display) compositor->render_event_base = 0; compositor->render_error_base = 0; } + else + compositor->have_render = TRUE; meta_verbose ("Render extension event base %d error base %d\n", compositor->render_event_base, compositor->render_error_base); - if (compositor->composite_event_base == 0 || - compositor->fixes_event_base == 0 || - compositor->render_event_base == 0 || - compositor->damage_event_base == 0) + if (!(compositor->have_composite && + compositor->have_fixes && + compositor->have_render && + compositor->have_damage)) { meta_verbose ("Failed to find all extensions needed for compositing manager, disabling compositing manager\n"); g_assert (!compositor->enabled); diff --git a/src/display.c b/src/display.c index bbfba65bf..d21ec79da 100644 --- a/src/display.c +++ b/src/display.c @@ -56,6 +56,8 @@ #endif #include +#include "expocity.h" + #define USE_GDK_DISPLAY typedef struct @@ -1321,7 +1323,19 @@ event_callback (XEvent *event, meta_compositor_process_event (display->compositor, event, window); - + + /* these are the window events at which expocity updates the thumbnail image + of the window */ + switch (event->type) + { + case CreateNotify: + case ButtonRelease: + case KeyRelease: + case FocusIn: + case FocusOut: + expocity_grab_window(window); + } + switch (event->type) { case KeyPress: diff --git a/src/keybindings.c b/src/keybindings.c index 921736e35..81ca5019b 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -29,6 +29,8 @@ #include "prefs.h" #include "effects.h" +#include "expocity.h" + #include #include #include @@ -2912,7 +2914,10 @@ do_choose_window (MetaDisplay *display, { MetaTabList type; MetaWindow *initial_selection; - + + expocity_run(display, screen); + return; + type = GPOINTER_TO_INT (binding->handler->data); meta_topic (META_DEBUG_KEYBINDINGS, diff --git a/src/main.c b/src/main.c index ef8218beb..ffb4aa0b2 100644 --- a/src/main.c +++ b/src/main.c @@ -28,6 +28,8 @@ #include "session.h" #include "prefs.h" +#include "expocity.h" + #include #include #ifdef HAVE_GCONF @@ -389,6 +391,9 @@ main (int argc, char **argv) /* must be after UI init so we can override GDK handlers */ meta_errors_init (); + /* initialize the expocity addon */ + expocity_init(); + #if 1 g_log_set_handler (NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, diff --git a/src/window.c b/src/window.c index 3a01d27a9..d73a86f03 100644 --- a/src/window.c +++ b/src/window.c @@ -40,6 +40,8 @@ #include "window-props.h" #include "constraints.h" +#include "expocity.h" + #include #include @@ -1043,6 +1045,7 @@ meta_window_free (MetaWindow *window) meta_icon_cache_free (&window->icon_cache); + expocity_free_window (window); g_free (window->sm_client_id); g_free (window->wm_client_machine); g_free (window->startup_id);