From 5a4784b64650064a760cef87ec286a6fc53436b4 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 13 Nov 2008 11:02:57 +0100 Subject: [PATCH] swindow: add cursor_set() Signed-off-by: Julien Danjou --- swindow.c | 14 ++++++++++++++ swindow.h | 1 + 2 files changed, 15 insertions(+) diff --git a/swindow.c b/swindow.c index 10d284e6a..33522594d 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 ca558cd68..49f142d34 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.