]> git.sur5r.net Git - i3/i3/blobdiff - src/xcursor.c
Change the root window cursor to 'watch' during startups
[i3/i3] / src / xcursor.c
index 69518c3073621451bb65cb8ba0bef9f0c69620be..5d209b56baf465057f65dd1ef6f8702352463867 100644 (file)
@@ -14,7 +14,8 @@ static Cursor cursors[XCURSOR_CURSOR_MAX];
 static const int xcb_cursors[XCURSOR_CURSOR_MAX] = {
     XCB_CURSOR_LEFT_PTR,
     XCB_CURSOR_SB_H_DOUBLE_ARROW,
-    XCB_CURSOR_SB_V_DOUBLE_ARROW
+    XCB_CURSOR_SB_V_DOUBLE_ARROW,
+    XCB_CURSOR_WATCH
 };
 
 static Cursor load_cursor(const char *name) {
@@ -28,6 +29,7 @@ void xcursor_load_cursors() {
     cursors[XCURSOR_CURSOR_POINTER] = load_cursor("left_ptr");
     cursors[XCURSOR_CURSOR_RESIZE_HORIZONTAL] = load_cursor("sb_h_double_arrow");
     cursors[XCURSOR_CURSOR_RESIZE_VERTICAL] = load_cursor("sb_v_double_arrow");
+    cursors[XCURSOR_CURSOR_WATCH] = load_cursor("watch");
 }
 
 /*
@@ -41,9 +43,9 @@ void xcursor_load_cursors() {
  * races might occur (even though we flush the Xlib connection).
  *
  */
-void xcursor_set_root_cursor() {
+void xcursor_set_root_cursor(int cursor_id) {
     XSetWindowAttributes attributes;
-    attributes.cursor = xcursor_get_cursor(XCURSOR_CURSOR_POINTER);
+    attributes.cursor = xcursor_get_cursor(cursor_id);
     XChangeWindowAttributes(xlibdpy, DefaultRootWindow(xlibdpy), CWCursor, &attributes);
     XFlush(xlibdpy);
 }