From b882ef093fb1092fcd52bd2604a1033238a87776 Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 10 Jul 2012 23:54:58 -0400 Subject: [PATCH] missed a XCreateFontCursor. Also convert XDefineCursor to XCB --- spectrwm.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/spectrwm.c b/spectrwm.c index 73b9aa3..a4759cf 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -7521,8 +7521,10 @@ setup_screens(void) { int i, j, k, num_screens; struct workspace *ws; - uint32_t gcv[1]; + uint32_t gcv[1], wa[1]; const xcb_query_extension_reply_t *qep; + xcb_cursor_t cursor; + xcb_font_t cursor_font; xcb_randr_query_version_cookie_t c; xcb_randr_query_version_reply_t *r; @@ -7544,6 +7546,14 @@ setup_screens(void) qep = xcb_get_extension_data(conn, &xcb_randr_id); xrandr_eventbase = qep->first_event; + cursor_font = xcb_generate_id(conn); + xcb_open_font(conn, cursor_font, strlen("cursor"), "cursor"); + + cursor = xcb_generate_id(conn); + xcb_create_glyph_cursor(conn, cursor, cursor_font, cursor_font, + XC_left_ptr, XC_left_ptr + 1, 0, 0, 0, 0xffff, 0xffff, 0xffff); + wa[0] = cursor; + /* map physical screens */ for (i = 0; i < num_screens; i++) { DNPRINTF(SWM_D_WS, "setup_screens: init screen: %d\n", i); @@ -7566,8 +7576,8 @@ setup_screens(void) XCB_GC_GRAPHICS_EXPOSURES, gcv); /* set default cursor */ - XDefineCursor(display, screens[i].root, - XCreateFontCursor(display, XC_left_ptr)); + xcb_change_window_attributes(conn, screens[i].root, + XCB_CW_CURSOR, wa); /* init all workspaces */ /* XXX these should be dynamically allocated too */ @@ -7595,6 +7605,8 @@ setup_screens(void) xcb_randr_select_input(conn, screens[i].root, XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE); } + xcb_free_cursor(conn, cursor); + xcb_close_font(conn, cursor_font); } void -- 1.7.10.4