#ifdef USE_XCB
#include <xcb/xproto.h>
+#include <xcb/xcb.h>
+#include <xcb/xcb_aux.h>
#endif
/* If we have Xfixes extension, use it for pointer blanking. */
if (!x->hourglass_window)
{
+#ifndef USE_XCB
unsigned long mask = CWCursor;
XSetWindowAttributes attrs;
#ifdef USE_GTK
x->hourglass_window = XCreateWindow
(dpy, parent, 0, 0, 32000, 32000, 0, 0,
InputOnly, CopyFromParent, mask, &attrs);
+#else
+ uint32_t cursor = (uint32_t) x->hourglass_cursor;
+#ifdef USE_GTK
+ xcb_window_t parent = (xcb_window_t) FRAME_X_WINDOW (f);
+#else
+ xcb_window_t parent = (xcb_window_t) FRAME_OUTER_WINDOW (f);
+#endif
+ x->hourglass_window
+ = (Window) xcb_generate_id (FRAME_DISPLAY_INFO (f)->xcb_connection);
+
+ xcb_create_window (FRAME_DISPLAY_INFO (f)->xcb_connection,
+ XCB_COPY_FROM_PARENT,
+ (xcb_window_t) x->hourglass_window,
+ parent, 0, 0, FRAME_PIXEL_WIDTH (f),
+ FRAME_PIXEL_HEIGHT (f), 0,
+ XCB_WINDOW_CLASS_INPUT_OUTPUT,
+ XCB_COPY_FROM_PARENT, XCB_CW_CURSOR,
+ &cursor);
+#endif
}
+#ifndef USE_XCB
XMapRaised (dpy, x->hourglass_window);
- XFlush (dpy);
/* Ensure that the spinning hourglass is shown. */
flush_frame (f);
+#else
+ uint32_t value = XCB_STACK_MODE_ABOVE;
+
+ xcb_configure_window (FRAME_DISPLAY_INFO (f)->xcb_connection,
+ (xcb_window_t) x->hourglass_window,
+ XCB_CONFIG_WINDOW_STACK_MODE, &value);
+ xcb_map_window (FRAME_DISPLAY_INFO (f)->xcb_connection,
+ (xcb_window_t) x->hourglass_window);
+ xcb_flush (FRAME_DISPLAY_INFO (f)->xcb_connection);
+#endif
}
}
}
/* Watch out for newly created frames. */
if (x->hourglass_window)
{
+#ifndef USE_XCB
XUnmapWindow (FRAME_X_DISPLAY (f), x->hourglass_window);
/* Sync here because XTread_socket looks at the
hourglass_p flag that is reset to zero below. */
XSync (FRAME_X_DISPLAY (f), False);
+#else
+ xcb_unmap_window (FRAME_DISPLAY_INFO (f)->xcb_connection,
+ (xcb_window_t) x->hourglass_window);
+ xcb_aux_sync (FRAME_DISPLAY_INFO (f)->xcb_connection);
+#endif
x->hourglass_p = false;
}
}