summaryrefslogtreecommitdiff
path: root/examples/cogl-x11-tfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cogl-x11-tfp.c')
-rw-r--r--examples/cogl-x11-tfp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/cogl-x11-tfp.c b/examples/cogl-x11-tfp.c
index b5803d01..b5859431 100644
--- a/examples/cogl-x11-tfp.c
+++ b/examples/cogl-x11-tfp.c
@@ -139,7 +139,8 @@ main (int argc, char **argv)
DefaultRootWindow (xdpy),
xvisinfo->visual,
AllocNone);
- mask = CWBorderPixel | CWColormap;
+ xattr.event_mask = StructureNotifyMask;
+ mask = CWBorderPixel | CWColormap | CWEventMask;
xwin = XCreateWindow (xdpy,
DefaultRootWindow (xdpy),
@@ -171,6 +172,14 @@ main (int argc, char **argv)
gc = XCreateGC (xdpy, tfp_xwin, 0, NULL);
+ while (TRUE)
+ {
+ XWindowEvent (xdpy, xwin, StructureNotifyMask, &xev);
+
+ if (xev.xany.type == MapNotify)
+ break;
+ }
+
pixmap = XCompositeNameWindowPixmap (xdpy, tfp_xwin);
tfp = cogl_texture_pixmap_x11_new (ctx, pixmap, TRUE, &error);