From bf595e6c8ad8c35535662c2d3e2f29c43867d919 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Fri, 21 Nov 2025 01:00:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20root=20=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wm.c | 2 ++ src/xwindow.c | 5 +++++ src/xwindow.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/wm.c b/src/wm.c index 980a3f0..93b91e8 100644 --- a/src/wm.c +++ b/src/wm.c @@ -26,6 +26,7 @@ #include "types.h" #include "utils.h" #include "xcursor.h" +#include "xwindow.h" static void wm_setup_signal(void); static void wm_check_other_wm(void); @@ -284,6 +285,7 @@ static void wm_setup(void) { monitor_draw_bar(m); } + xwindow_change_cursor(wm.screen->root, cursor_normal); xcb_flush(wm.xcb_conn); } diff --git a/src/xwindow.c b/src/xwindow.c index a066d8a..8aca2db 100644 --- a/src/xwindow.c +++ b/src/xwindow.c @@ -100,3 +100,8 @@ visual_t *xwindow_get_xcb_visual(bool prefer_alpha) { return visual; } + +void xwindow_change_cursor(xcb_window_t window, cursor_t cursor) { + xcb_params_cw_t params = {.cursor = xcursor_get_xcb_cursor(cursor)}; + xcb_aux_change_window_attributes(wm.xcb_conn, window, XCB_CW_CURSOR, ¶ms); +} diff --git a/src/xwindow.h b/src/xwindow.h index 5b8051b..dd2af65 100644 --- a/src/xwindow.h +++ b/src/xwindow.h @@ -3,9 +3,12 @@ #include #include +#include "xcursor.h" + typedef struct visual_t { uint8_t depth; xcb_visualtype_t *visual; } visual_t; visual_t *xwindow_get_xcb_visual(bool prefer_alpha); +void xwindow_change_cursor(xcb_window_t window, cursor_t cursor);