summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippo Argiolas <filippo.argiolas@gmail.com>2009-04-06 09:23:53 +0200
committerFilippo Argiolas <filippo.argiolas@gmail.com>2009-04-06 09:23:53 +0200
commite81bbaa5aff4789969844fd398ed6c3a35b5c977 (patch)
tree049bfc1fb161593fc676d42fa88faf83b5b7fa43
parentf149e818e1091aeac0aa12971750508dcf05a665 (diff)
Allow input passthrough in the video window
Set a null sized input shape to prevent offscreen video windows to steal input from the clutter stage.
-rw-r--r--src/cheese-texture.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/cheese-texture.c b/src/cheese-texture.c
index bb546f7..1893a45 100644
--- a/src/cheese-texture.c
+++ b/src/cheese-texture.c
@@ -22,6 +22,8 @@
#include <X11/Xlib.h>
#include <X11/extensions/Xcomposite.h>
+#include <X11/extensions/Xfixes.h>
+#include <X11/extensions/shape.h>
#include <clutter/clutter.h>
#include <clutter/x11/clutter-x11.h>
@@ -107,8 +109,6 @@ cheese_texture_init (CheeseTexture * self)
Display *disp;
Window win;
Window stage_win;
- XSetWindowAttributes attr;
- unsigned long mask;
ClutterActor *stage;
@@ -117,18 +117,15 @@ cheese_texture_init (CheeseTexture * self)
stage = clutter_stage_get_default ();
stage_win = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
- attr.background_pixel = BlackPixel (disp, DefaultScreen (disp));
- attr.event_mask = SubstructureNotifyMask | StructureNotifyMask;
- mask = CWEventMask | CWBackPixel;
-/* win = XCreateSimpleWindow (disp, stage_win,
- 0, 0, DEFAULT_W, DEFAULT_H, 0, 0, BlackPixel (disp, DefaultScreen (disp)));
-*/
-
-/* FIXME: Find a way to not steal parent's input */
- win = XCreateWindow (disp, stage_win,
- -20000, -20000, DEFAULT_W, DEFAULT_H, 0,
- CopyFromParent, InputOutput, CopyFromParent, mask, &attr);
+ win = XCreateSimpleWindow (disp, stage_win,
+ 0, 0, DEFAULT_W, DEFAULT_H, 0, 0,
+ BlackPixel (disp, DefaultScreen (disp)));
+ /* Allow input passthrough: don't steal clutter's input */
+ XserverRegion region = XFixesCreateRegion (disp, NULL, 0);
+ XFixesSetWindowShapeRegion (disp, win, ShapeBounding, 0, 0, 0);
+ XFixesSetWindowShapeRegion (disp, win, ShapeInput, 0, 0, region);
+ XFixesDestroyRegion (disp, region);
priv->parent = stage_win;