- fmt.i_rmask = xfmt->red_mask;
- fmt.i_gmask = xfmt->green_mask;
- fmt.i_bmask = xfmt->blue_mask;
+ if (f->depth != depth)
+ continue; /* this would fail anyway */
+
+ const uint32_t mask =
+ /* XCB_CW_EVENT_MASK */
+ XCB_EVENT_MASK_VISIBILITY_CHANGE;
+ xcb_void_cookie_t c;
+
+ c = xcb_create_window_checked (conn, f->depth, p_sys->window,
+ p_sys->embed->handle.xid, 0, 0, 1, 1, 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT, f->visual,
+ XCB_CW_EVENT_MASK, &mask);
+
+ if (!CheckError (vd, conn, "cannot create X11 window", c))
+ {
+ msg_Dbg (vd, "using X11 visual ID 0x%"PRIx32
+ " (depth: %"PRIu8")", f->visual, f->depth);
+ msg_Dbg (vd, "using X11 window 0x%08"PRIx32, p_sys->window);
+ goto created_window;
+ }