#include <gdk/gdkx.h> #include <gtk/gtk.h> int main (void) { GdkPixbuf *pixbuf = NULL; GdkCursor *cursor = NULL; gtk_init (NULL, NULL); pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), "browser_cursor", 32, 0, NULL); g_assert (pixbuf); gint x = (gdk_pixbuf_get_width (pixbuf) / 2) - 7; /* Maths is shitty */ gint y = (gdk_pixbuf_get_height (pixbuf) / 2) - 7; cursor = gdk_cursor_new_from_pixbuf (gdk_display_get_default (), pixbuf, x, y); /* I should be freeing you (and others)... */ g_assert (cursor); gdk_window_set_cursor (gdk_window_foreign_new (GDK_ROOT_WINDOW ()), cursor); g_idle_add ((GSourceFunc) gtk_main_quit, NULL); gtk_main (); return 0; }