src/xcursor.c File Reference

#include <assert.h>
#include <X11/Xcursor/Xcursor.h>
#include <X11/cursorfont.h>
#include "i3.h"
#include "xcb.h"
#include "xcursor.h"
Include dependency graph for xcursor.c:

Go to the source code of this file.

Functions

static Cursor load_cursor (const char *name)
void xcursor_load_cursors ()
void xcursor_set_root_cursor ()
 Sets the cursor of the root window to the 'pointer' cursor.
Cursor xcursor_get_cursor (enum xcursor_cursor_t c)
int xcursor_get_xcb_cursor (enum xcursor_cursor_t c)

Variables

static Cursor cursors [XCURSOR_CURSOR_MAX]
static const int xcb_cursors [XCURSOR_CURSOR_MAX]

Function Documentation

static Cursor load_cursor ( const char *  name  )  [static]

Definition at line 20 of file xcursor.c.

References xcursor_supported, and xlibdpy.

Referenced by xcursor_load_cursors().

Cursor xcursor_get_cursor ( enum xcursor_cursor_t  c  ) 

Definition at line 51 of file xcursor.c.

References cursors, and XCURSOR_CURSOR_MAX.

Referenced by create_window(), and xcursor_set_root_cursor().

int xcursor_get_xcb_cursor ( enum xcursor_cursor_t  c  ) 

Definition at line 56 of file xcursor.c.

References xcb_cursors, and XCURSOR_CURSOR_MAX.

Referenced by create_window(), and main().

void xcursor_load_cursors (  ) 

Definition at line 27 of file xcursor.c.

References cursors, load_cursor(), XCURSOR_CURSOR_POINTER, XCURSOR_CURSOR_RESIZE_HORIZONTAL, and XCURSOR_CURSOR_RESIZE_VERTICAL.

Referenced by main().

Here is the call graph for this function:

void xcursor_set_root_cursor (  ) 

Sets the cursor of the root window to the 'pointer' cursor.

This function is called when i3 is initialized, because with some login managers, the root window will not have a cursor otherwise.

We have a separate xcursor function to use the same X11 connection as the xcursor_load_cursors() function. If we mix the Xlib and the XCB connection, races might occur (even though we flush the Xlib connection).

Definition at line 44 of file xcursor.c.

References XCURSOR_CURSOR_POINTER, xcursor_get_cursor(), and xlibdpy.

Referenced by main().

Here is the call graph for this function:


Variable Documentation

Cursor cursors[XCURSOR_CURSOR_MAX] [static]

Definition at line 12 of file xcursor.c.

Referenced by xcursor_get_cursor(), and xcursor_load_cursors().

const int xcb_cursors[XCURSOR_CURSOR_MAX] [static]

Generated on 7 Feb 2013 for i3 by  doxygen 1.6.1