19#include <X11/Xcursor/Xcursor.h>
24#include "acfutils/png.h"
35static int dpy_refcount = 0;
36static Display *dpy = NULL;
44 XcursorImage img = { .pixels = NULL };
46 ASSERT(filename_png != NULL);
48 buf = png_load_from_file_rgba(filename_png, &w, &h);
52 if (dpy_refcount == 0)
53 dpy = XOpenDisplay(NULL);
55 logMsg(
"Can't open display");
66 img.pixels = (XcursorPixel *)buf;
68 cursor->crs = XcursorImageLoadCursor(dpy, &img);
82 XFreeCursor(dpy, cursor->crs);
87 if (dpy_refcount == 0) {
96 dr_t system_window_dr;
102 fdr_find(&system_window_dr,
"sim/operation/windows/system_window_64");
104 memcpy(&win, win_ptr,
sizeof (
void *));
106 XDefineCursor(dpy, win, cursor->crs);
#define ASSERT3S(x, op, y)
#define VERIFY3S(x, op, y)
void cursor_make_current(cursor_t *cursor)
cursor_t * cursor_read_from_file(const char *filename_png)
void cursor_free(cursor_t *cursor)
#define dr_getvi(__dr, __i, __off, __num)
static void * safe_calloc(size_t nmemb, size_t size)