[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cairo
Subject:    [cairo] hiding the mouse cursor in fdclock
From:       Amaury Jacquot <sxpert () esitcom ! org>
Date:       2003-12-14 13:50:05
Message-ID: 1071409804.3823.1.camel () sxpert
[Download RAW message or body]

here's a patch that hides the mouse cursor and thus prevents it blinking



["fdclock.hidemouse.patch" (fdclock.hidemouse.patch)]

--- fdclock.c.old	2003-12-14 14:15:23.000000000 +0100
+++ fdclock.c	2003-12-14 14:44:19.000000000 +0100
@@ -135,7 +135,12 @@
     Bool		    paint = False;
     int			    timeout;
     cairo_t		    *cr = cairo_create ();
-    
+
+    XColor		    black;
+    char		    cursordata[1];
+    Pixmap		    cursorpixmap;
+    Cursor		    cursor;    
+
     dpy = XOpenDisplay (dpy_name);
     if (!dpy)
     {
@@ -203,6 +208,16 @@
 	timeout = 100;
     else
 	timeout = 1000;
+
+    /* hides the mouse pointer, shamelessly stolen from gstreamer Gui/wm/ws.c lines 994 and under */
+    cursordata[0]=0;
+    cursorpixmap=XCreateBitmapFromData(dpy,root,cursordata,1,1);
+    black.red=0;	
+    black.green=0;
+    black.blue=0;
+    cursor=XCreatePixmapCursor(dpy,cursorpixmap,cursorpixmap,&black,&black,0,0);
+    XDefineCursor(dpy,w,cursor);
+
     for (;;)
     {
 	struct pollfd	a;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic