diff --git a/swindow.c b/swindow.c index 10d284e6..33522594 100644 --- a/swindow.c +++ b/swindow.c @@ -288,4 +288,18 @@ simplewindow_orientation_set(simple_window_t *sw, orientation_t o) } } +/** Set simple window cursor. + * \param sw The simple window. + * \param c The cursor. + */ +void +simplewindow_cursor_set(simple_window_t *sw, xcb_cursor_t c) +{ + if(sw->window) + { + const uint32_t change_win_vals[] = { c }; + xcb_change_window_attributes(globalconf.connection, sw->window, XCB_CW_CURSOR, change_win_vals); + } +} + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/swindow.h b/swindow.h index ca558cd6..49f142d3 100644 --- a/swindow.h +++ b/swindow.h @@ -63,6 +63,7 @@ void simplewindow_refresh_pixmap_partial(simple_window_t *, int16_t, int16_t, ui void simplewindow_border_width_set(simple_window_t *, uint32_t); void simplewindow_border_color_set(simple_window_t *, const xcolor_t *); void simplewindow_orientation_set(simple_window_t *, orientation_t); +void simplewindow_cursor_set(simple_window_t *, xcb_cursor_t); /** Refresh the window content by copying its pixmap data to its window. * \param sw The simple window to refresh.