summaryrefslogtreecommitdiff
path: root/src/cheese-texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cheese-texture.c')
-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;