XFixes was the way to go. I was worried that the package wasn't on the system and I didn't feel like putting it there. Luckily it was included and all I had to do was patch matchbox. Attached is the diff file if anyone wants to patch theirs.

I patched matchbox-remote to accept another option and the wm to detect the event that is sent to X. To change the cursor visibility on the fly:

Hide the cursor:  matchbox-remote -h
Show the cursor:  matchbox-remote -s

Thanks,
--
Tyler McClung
[email protected]
Only in matchbox-window-manager-1.2/: config.h
Only in matchbox-window-manager-1.2/: config.log
Only in matchbox-window-manager-1.2/: config.status
Only in matchbox-window-manager-1.2/data: Makefile
Only in matchbox-window-manager-1.2/data/schemas: Makefile
Only in matchbox-window-manager-1.2/data/themes/blondie: Makefile
Only in matchbox-window-manager-1.2/data/themes/Default: Makefile
Only in matchbox-window-manager-1.2/data/themes: Makefile
Only in matchbox-window-manager-1.2/data/themes/MBOpus: Makefile
Only in matchbox-window-manager-1.2/: Makefile
Only in matchbox-window-manager-1.2/src: base_client.o
Only in matchbox-window-manager-1.2/src: client_common.o
Only in matchbox-window-manager-1.2/src: composite-engine.o
Only in matchbox-window-manager-1.2/src: .deps
Only in matchbox-window-manager-1.2/src: desktop_client.o
Only in matchbox-window-manager-1.2/src: dialog_client.o
Only in matchbox-window-manager-1.2/src: dockbar_client.o
Only in matchbox-window-manager-1.2/src: ewmh.o
Only in matchbox-window-manager-1.2/src: keys.o
Only in matchbox-window-manager-1.2/src: list.o
Only in matchbox-window-manager-1.2/src: main.c~
Only in matchbox-window-manager-1.2/src: main_client.o
Only in matchbox-window-manager-1.2/src: main.o
Only in matchbox-window-manager-1.2/src: Makefile
Only in matchbox-window-manager-1.2/src: matchbox-remote
diff -ur matchbox-window-manager-1.2.orig/src/matchbox-remote.c matchbox-window-manager-1.2/src/matchbox-remote.c
--- matchbox-window-manager-1.2.orig/src/matchbox-remote.c	2006-11-17 03:37:14.000000000 -0800
+++ matchbox-window-manager-1.2/src/matchbox-remote.c	2009-07-15 12:00:33.000000000 -0700
@@ -22,7 +22,7 @@
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
- 
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -37,6 +37,8 @@
 #define MB_CMD_MISC          7
 #define MB_CMD_COMPOSITE     8
 #define MB_CMB_KEYS_RELOAD   9
+#define CMD_HIDE_CURSOR     10
+#define CMD_SHOW_CURSOR     11
 
 #define MB_CMD_PANEL_TOGGLE_VISIBILITY 1
 #define MB_CMD_PANEL_SIZE              2
@@ -130,7 +132,7 @@
    desktop_manager_atom = XInternAtom(dpy, "_NET_DESKTOP_MANGER",False);
 
    root = DefaultRootWindow(dpy);
-   
+
    if (cmd_id == MB_CMD_SET_THEME)
    {
       theme_prop = XInternAtom(dpy, "_MB_THEME", False);
@@ -227,14 +229,12 @@
 
 int main(int argc, char* argv[])
 {
-  char *display_name = (char *)getenv("DISPLAY");
   int i;
-
   if (argc < 2) usage(argv[0]);
   
-  dpy = XOpenDisplay(display_name);
+  dpy = XOpenDisplay(NULL);
   if (dpy == NULL) {
-     printf("Cant connect to display: %s\n", display_name);
+     printf("Cant connect to display: %s\n", XDisplayName(NULL));
      exit(1);
   }
 
@@ -268,6 +268,12 @@
 	case 'k':
 	  mbcommand(MB_CMB_KEYS_RELOAD, NULL);
 	  break;
+        case 'h':
+          mbcommand(CMD_HIDE_CURSOR, NULL);
+          break;
+        case 's':
+          mbcommand(CMD_SHOW_CURSOR, NULL);
+          break;
 	case 'p':
 	  if (!strcmp(arg+1,"panel-toggle"))
 	    {
Only in matchbox-window-manager-1.2/src: matchbox-remote.c~
Only in matchbox-window-manager-1.2/src: matchbox-remote.o
Only in matchbox-window-manager-1.2/src: matchbox-window-manager
Only in matchbox-window-manager-1.2/src: mbtheme-standalone.o
Only in matchbox-window-manager-1.2/src: misc.o
Only in matchbox-window-manager-1.2/src: select_client.o
Only in matchbox-window-manager-1.2/src: session.o
Only in matchbox-window-manager-1.2/src: stack.o
diff -ur matchbox-window-manager-1.2.orig/src/structs.h matchbox-window-manager-1.2/src/structs.h
--- matchbox-window-manager-1.2.orig/src/structs.h	2007-03-19 04:07:15.000000000 -0700
+++ matchbox-window-manager-1.2/src/structs.h	2009-07-14 09:53:22.000000000 -0700
@@ -145,6 +145,8 @@
 #define MB_CMD_MISC        7 	/* spare, used for debugging */
 #define MB_CMD_COMPOSITE   8
 #define MB_CMB_KEYS_RELOAD 9
+#define CMD_HIDE_CURSOR   10
+#define CMD_SHOW_CURSOR   11
 
 /* Atoms, if you change these check ewmh_init() first */
 
Only in matchbox-window-manager-1.2/src: structs.h~
Only in matchbox-window-manager-1.2/src: toolbar_client_alt.o
Only in matchbox-window-manager-1.2/src: toolbar_client.o
diff -ur matchbox-window-manager-1.2.orig/src/wm.c matchbox-window-manager-1.2/src/wm.c
--- matchbox-window-manager-1.2.orig/src/wm.c	2007-03-19 04:16:10.000000000 -0700
+++ matchbox-window-manager-1.2/src/wm.c	2009-07-15 12:00:06.000000000 -0700
@@ -942,7 +942,6 @@
 	    dbg("%s() ignoring event->type : %d\n", __func__, ev.type);
 	    break;
 	  }
-
 	comp_engine_handle_events(w, &ev);
 
 #ifdef USE_XSYNC
@@ -999,6 +998,18 @@
 
 }
 
+void wm_handle_change_cursor_event(Wm *w, int visible) 
+{
+   if (visible == 0) 
+   {
+     XFixesHideCursor (w->dpy, w->root);
+   }
+   else 
+   {
+      XFixesShowCursor (w->dpy, w->root);
+   }
+}
+
 void
 wm_handle_button_event(Wm *w, XButtonEvent *e)
 {
@@ -1687,6 +1698,12 @@
        dbg("%s() mb command requested %li\n", __func__, e->data.l[0] );
        switch (e->data.l[0])
 	 {
+          case CMD_SHOW_CURSOR : //Our custom event type (On Cursor Visibility changed)
+            wm_handle_change_cursor_event(w, 1); 
+            break;
+          case CMD_HIDE_CURSOR : //Our custom event type (On Cursor Visibility changed)
+            wm_handle_change_cursor_event(w, 0); 
+            break;
 #ifndef STANDALONE
 	 case MB_CMD_SET_THEME :
 	   {
@@ -1716,7 +1733,7 @@
 
 	     return;
 	   }
-#endif
+#endif  
 	 case MB_CMD_EXIT      :
 	   exit(0);
 	 case MB_CMD_NEXT      :
Only in matchbox-window-manager-1.2/src: wm.c~
Only in matchbox-window-manager-1.2/src: wm.h~
Only in matchbox-window-manager-1.2/src: wm.o
Only in matchbox-window-manager-1.2/: stamp-h1
_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to