From ae906b318aa9412e7dabd95d96029c7cc539d7c7 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Thu, 16 Oct 2008 07:50:49 +0100 Subject: [PATCH] API for enabling/disabling input to stage window. --- .../compositor-clutter-plugin-manager.c | 33 +++++++++++++++++++ src/compositor/clutter/compositor-clutter.c | 9 +++++ src/include/compositor-clutter-plugin.h | 5 +++ src/include/compositor-clutter.h | 3 ++ 4 files changed, 50 insertions(+) diff --git a/src/compositor/clutter/compositor-clutter-plugin-manager.c b/src/compositor/clutter/compositor-clutter-plugin-manager.c index b9c7b740d..f20a7eb4e 100644 --- a/src/compositor/clutter/compositor-clutter-plugin-manager.c +++ b/src/compositor/clutter/compositor-clutter-plugin-manager.c @@ -29,6 +29,9 @@ #include #include +#include +#include +#include static gboolean meta_compositor_clutter_plugin_manager_reload (MetaCompositorClutterPluginManager *mgr); @@ -710,3 +713,33 @@ meta_comp_clutter_plugin_effect_completed (MetaCompositorClutterPlugin *plugin, meta_compositor_clutter_window_effect_completed (actor, event); } + +void +meta_comp_clutter_plugin_set_stage_reactive (MetaCompositorClutterPlugin *plugin, + gboolean reactive) +{ + MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; + MetaCompositorClutterPluginManager *mgr = priv->self; + MetaDisplay *display = meta_screen_get_display (mgr->screen); + Display *xdpy = meta_display_get_xdisplay (display); + Window overlay; + + overlay = meta_compositor_clutter_get_overlay_window (mgr->screen); + + static XserverRegion region = None; + + if (region == None) + region = XFixesCreateRegion (xdpy, NULL, 0); + + if (reactive) + { + XFixesSetWindowShapeRegion (xdpy, overlay, + ShapeInput, 0, 0, None); + } + else + { + XFixesSetWindowShapeRegion (xdpy, overlay, + ShapeInput, 0, 0, region); + } +} + diff --git a/src/compositor/clutter/compositor-clutter.c b/src/compositor/clutter/compositor-clutter.c index 38f223c8d..3f83a695b 100644 --- a/src/compositor/clutter/compositor-clutter.c +++ b/src/compositor/clutter/compositor-clutter.c @@ -2247,6 +2247,15 @@ meta_compositor_clutter_new (MetaDisplay *display) #endif } +Window +meta_compositor_clutter_get_overlay_window (MetaScreen *screen) +{ + MetaCompScreen *info = meta_screen_get_compositor_data (screen); + + return info->output; +} + + /* ------------------------------- */ /* Shadow Generation */ diff --git a/src/include/compositor-clutter-plugin.h b/src/include/compositor-clutter-plugin.h index 504d08294..21f6f49f2 100644 --- a/src/include/compositor-clutter-plugin.h +++ b/src/include/compositor-clutter-plugin.h @@ -243,4 +243,9 @@ meta_comp_clutter_plugin_get_overlay_group (MetaCompositorClutterPlugin *plugin) ClutterActor * meta_comp_clutter_plugin_get_stage (MetaCompositorClutterPlugin *plugin); + +void +meta_comp_clutter_plugin_set_stage_reactive (MetaCompositorClutterPlugin *plugin, + gboolean reactive); + #endif diff --git a/src/include/compositor-clutter.h b/src/include/compositor-clutter.h index 0663ef9de..7f79469be 100644 --- a/src/include/compositor-clutter.h +++ b/src/include/compositor-clutter.h @@ -70,4 +70,7 @@ void meta_compositor_clutter_window_effect_completed (MetaCompWindow *actor, gul ClutterActor * meta_compositor_clutter_get_stage_for_screen (MetaScreen *screen); ClutterActor * meta_compositor_clutter_get_overlay_group_for_screen (MetaScreen *screen); +Window meta_compositor_clutter_get_overlay_window (MetaScreen *screen); + + #endif