diff --git a/src/compositor/compositor-private.h b/src/compositor/compositor-private.h index fee897645..f7fc1afbe 100644 --- a/src/compositor/compositor-private.h +++ b/src/compositor/compositor-private.h @@ -39,9 +39,9 @@ struct _MetaCompositor void (*set_updates) (MetaCompositor *compositor, MetaWindow *window, gboolean update); - void (*process_event) (MetaCompositor *compositor, - XEvent *event, - MetaWindow *window); + gboolean (*process_event) (MetaCompositor *compositor, + XEvent *event, + MetaWindow *window); Pixmap (*get_window_pixmap) (MetaCompositor *compositor, MetaWindow *window); void (*set_active_window) (MetaCompositor *compositor, diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index ba74a5df3..814c9f19c 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -2391,14 +2391,14 @@ process_destroy (MetaCompositorXRender *compositor, destroy_win (compositor->display, event->window, FALSE); } -static void +static gboolean process_damage (MetaCompositorXRender *compositor, XDamageNotifyEvent *event) { MetaCompWindow *cw = find_window_in_display (compositor->display, event->drawable); if (cw == NULL) - return; + return FALSE; repair_win (cw); @@ -2406,6 +2406,8 @@ process_damage (MetaCompositorXRender *compositor, if (event->more == FALSE) add_repair (compositor->display); #endif + + return TRUE; } static void @@ -2737,7 +2739,7 @@ xrender_free_window (MetaCompositor *compositor, } #endif /* 0 */ -static void +static gboolean xrender_process_event (MetaCompositor *compositor, XEvent *event, MetaWindow *window) @@ -2798,7 +2800,7 @@ xrender_process_event (MetaCompositor *compositor, else { meta_error_trap_pop (xrc->display, FALSE); - return; + return FALSE; } break; } @@ -2808,7 +2810,7 @@ xrender_process_event (MetaCompositor *compositor, repair_display (xrc->display); #endif - return; + return FALSE; #endif } diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 8d134c3da..733ba3815 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -106,14 +106,16 @@ meta_compositor_set_updates (MetaCompositor *compositor, #endif } -void +gboolean meta_compositor_process_event (MetaCompositor *compositor, XEvent *event, MetaWindow *window) { #ifdef HAVE_COMPOSITE_EXTENSIONS if (compositor && compositor->process_event) - compositor->process_event (compositor, event, window); + return compositor->process_event (compositor, event, window); + else + return FALSE; #endif } diff --git a/src/compositor/mutter/compositor-mutter.c b/src/compositor/mutter/compositor-mutter.c index 566f70920..e5acd928c 100644 --- a/src/compositor/mutter/compositor-mutter.c +++ b/src/compositor/mutter/compositor-mutter.c @@ -1748,7 +1748,7 @@ clutter_cmp_set_updates (MetaCompositor *compositor, #endif } -static void +static gboolean clutter_cmp_process_event (MetaCompositor *compositor, XEvent *event, MetaWindow *window) @@ -1764,11 +1764,10 @@ clutter_cmp_process_event (MetaCompositor *compositor, screen = meta_window_get_screen (window); info = meta_screen_get_compositor_data (screen); - if (mutter_plugin_manager_xevent_filter (info->plugin_mgr, - event) == TRUE) + if (mutter_plugin_manager_xevent_filter (info->plugin_mgr, event)) { DEBUG_TRACE ("clutter_cmp_process_event (filtered,window==NULL)\n"); - return; + return TRUE; } } else @@ -1785,11 +1784,10 @@ clutter_cmp_process_event (MetaCompositor *compositor, info = meta_screen_get_compositor_data (screen); - if (mutter_plugin_manager_xevent_filter (info->plugin_mgr, - event) == TRUE) + if (mutter_plugin_manager_xevent_filter (info->plugin_mgr, event)) { DEBUG_TRACE ("clutter_cmp_process_event (filtered,window==NULL)\n"); - return; + return TRUE; } l = l->next; @@ -1828,6 +1826,11 @@ clutter_cmp_process_event (MetaCompositor *compositor, meta_error_trap_pop (xrc->display, FALSE); + /* The above handling is basically just "observing" the events, so we return + * FALSE to indicate that the event should not be filtered out; if we have + * GTK+ windows in the same process, GTK+ needs the ConfigureNotify event, for example. + */ + return FALSE; #endif } diff --git a/src/core/display.c b/src/core/display.c index 318aeea6e..5bad68a36 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2424,9 +2424,10 @@ event_callback (XEvent *event, if (display->compositor) { - meta_compositor_process_event (display->compositor, - event, - window); + if (meta_compositor_process_event (display->compositor, + event, + window)) + filter_out_event = TRUE; } display->current_time = CurrentTime; diff --git a/src/include/compositor.h b/src/include/compositor.h index 59eaade0a..b36883315 100644 --- a/src/include/compositor.h +++ b/src/include/compositor.h @@ -73,9 +73,9 @@ void meta_compositor_set_updates (MetaCompositor *compositor, MetaWindow *window, gboolean updates); -void meta_compositor_process_event (MetaCompositor *compositor, - XEvent *event, - MetaWindow *window); +gboolean meta_compositor_process_event (MetaCompositor *compositor, + XEvent *event, + MetaWindow *window); Pixmap meta_compositor_get_window_pixmap (MetaCompositor *compositor, MetaWindow *window); void meta_compositor_set_active_window (MetaCompositor *compositor,