X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fxcursor.c;h=1e1e23b0dedadd2d6ae342e71a8edded2d541088;hb=00cf467114ac15a9f7eb937c761939727fb741a2;hp=dcbe2ad0d8cd5c0c9b678dab97d394e7e94bcdae;hpb=1a7fe4ee79dd707d33832c672c8e1c5a5619b983;p=i3%2Fi3 diff --git a/src/xcursor.c b/src/xcursor.c index dcbe2ad0..1e1e23b0 100644 --- a/src/xcursor.c +++ b/src/xcursor.c @@ -4,7 +4,7 @@ * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager - * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE) + * © 2009 Michael Stapelberg and contributors (see also: LICENSE) * * xcursor.c: xcursor support for themed cursors. * @@ -23,8 +23,7 @@ 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_WATCH -}; + XCB_CURSOR_WATCH}; void xcursor_load_cursors(void) { if (xcb_cursor_context_new(conn, root_screen, &ctx) < 0) { @@ -32,8 +31,8 @@ void xcursor_load_cursors(void) { xcursor_supported = false; return; } -#define LOAD_CURSOR(constant, name) \ - do { \ +#define LOAD_CURSOR(constant, name) \ + do { \ cursors[constant] = xcb_cursor_load_cursor(ctx, name); \ } while (0) LOAD_CURSOR(XCURSOR_CURSOR_POINTER, "left_ptr"); @@ -57,15 +56,15 @@ void xcursor_load_cursors(void) { */ void xcursor_set_root_cursor(int cursor_id) { xcb_change_window_attributes(conn, root, XCB_CW_CURSOR, - (uint32_t[]){ xcursor_get_cursor(cursor_id) }); + (uint32_t[]){xcursor_get_cursor(cursor_id)}); } xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c) { - assert(c >= 0 && c < XCURSOR_CURSOR_MAX); + assert(c < XCURSOR_CURSOR_MAX); return cursors[c]; } int xcursor_get_xcb_cursor(enum xcursor_cursor_t c) { - assert(c >= 0 && c < XCURSOR_CURSOR_MAX); + assert(c < XCURSOR_CURSOR_MAX); return xcb_cursors[c]; }