[g-a-devel]Help with simple application



Hi All,

I'm hoping that this is the tight place to ask this. Basically, I was trying to write a small utility for friend who has limited vision and keeps loosing track of the mouse pointer. My current code (using only X calls) does this:

1. Open an X connection: XOpenDisplay()
2. Create a large cursor: XCreatePixmapCursor()
3. Change default cursor to large cursor: XGrabPointer()
4. Wait for a button click: loop on XNextEvent()
5. Revert to default cursor: XUngrabPointer()
6. Close X connection: XCloseDisplay()

Creating a keyboard shortcut to this program would allow him to quickly find the cursor and then click any button to make it go away. 

Works fine from the command line, or if the cursor is originally over the root window. But if it is over some other window and I hit the keys, I get a GrabFrozen from XGrabPointer(). I'm stuck at this point and my limited knowledge (developed over the last couple of days) does not help.

Before I get flamed for sending this mail to this list, let me mention that I have (a) tried asking in the X mailing lists (no response), (b) tried looking at existing magnifier programs (could be used, but too heavy for this purpose), (c) I am willing to switch to Gtk or Gnome APIs if someone would point me in the right direction (never used any UI APIs before).

Any suggestions? 
Thanks in advance,
Pankaj

-- 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]