repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 2e1531dabb5a02e41a7d0ad97a6d70517efceffd:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 2e1531dabb5a02e41a7d0ad97a6d70517efceffd
Author: Emanuele Giaquinta 
Date:   Tue Jun 16 11:58:26 2015 +0000

    Add pointerShape resource to change the mouse pointer shape.

    Based on a patch by Brian Watson.

diff --git a/configure.ac b/configure.ac
index a50782ca26526040ebd542db85ad858170f69f0f..
index ..f077d8a766feb45a8d504040583bade7a85aacad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -452,6 +452,14 @@ fi
 AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
 AC_SUBST(STARTUP_NOTIFICATION_LIBS)

+if test x$support_frills = xyes; then
+  RXVT_CHECK_MODULES([XMU], [xmu], [
+    X_LIBS="$XMU_LIBS $X_LIBS"
+    CPPFLAGS="$CPPFLAGS $XMU_CFLAGS"
+    AC_DEFINE(HAVE_XMU, 1, Define to enable Xmu support)
+  ], [:])
+fi
+
 dnl# --------------------------------------------------------------------------
 dnl# CHECKING FOR HEADER FILES
 dnl# --------------------------------------------------------------------------
diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod
index 571abb304bc4e7c6584c4204e0601fd74c75444a..
index ..24d585e65e55c117532b74e39749a8b0e3c61ac1 100644
--- a/doc/rxvt.1.pod
+++ b/doc/rxvt.1.pod
@@ -947,6 +947,12 @@ Mouse pointer foreground colour.

 Mouse pointer background colour.

+=item B I
+
+Compile I: Specifies the name of the mouse pointer shape
+[default B]. See the macros in the B include
+file for possible values (omit the C prefix).
+
 =item B I

 Specifies number of seconds before blanking the pointer [default 2]. Use a
diff --git a/src/init.C b/src/init.C
index 3aa5bcebd7e99de935a2d1b227c0ca344219b493..
index ..2b155907784e806536d83d9ba6d63928d25ce757 100644
--- a/src/init.C
+++ b/src/init.C
@@ -44,6 +44,10 @@

 #include 

+#ifdef HAVE_XMU
+# include 
+#endif
+
 #ifdef HAVE_XSETLOCALE
 # define X_LOCALE
 # include 
@@ -1405,7 +1409,18 @@ rxvt_term::create_windows (int argc, const char *const *argv)
   termwin_ev.start (display, top);

   /* vt cursor: Black-on-White is standard, but this is more popular */
-  TermWin_cursor = XCreateFontCursor (dpy, XC_xterm);
+  unsigned int shape = XC_xterm;
+
+#ifdef HAVE_XMU
+  if (rs[Rs_pointerShape])
+    {
+      int stmp = XmuCursorNameToIndex (rs[Rs_pointerShape]);
+      if (stmp >= 0)
+        shape = stmp;
+    }
+#endif
+
+  TermWin_cursor = XCreateFontCursor (dpy, shape);

   /* the vt window */
   vt = XCreateSimpleWindow (dpy, top,
diff --git a/src/rsinc.h b/src/rsinc.h
index 682322c360aa059d04be1dd38c779b2e1b2ddeff..
index ..86d0dfe45fe20da4f68cf7a88379d6e5223fbb58 100644
--- a/src/rsinc.h
+++ b/src/rsinc.h
@@ -121,3 +121,6 @@
 #if ENABLE_EWMH
   def (iconfile)
 #endif
+#ifdef HAVE_XMU
+  def (pointerShape)
+#endif
diff --git a/src/xdefaults.C b/src/xdefaults.C
index 619edfb54b350dab7ef84605c08bbf7980f544ef..
index ..c58b6af3573c3c043201c8d8edfaf2f7bf472eee 100644
--- a/src/xdefaults.C
+++ b/src/xdefaults.C
@@ -202,6 +202,9 @@ optList[] = {
 #endif
 #if ENABLE_EWMH
               STRG (Rs_iconfile, "iconFile", "icon", "file", "path to application icon image"),
+#endif
+#ifdef HAVE_XMU
+              RSTRG (Rs_pointerShape, "pointerShape", "string"),
 #endif
               /* fonts: command-line option = resource name */
               STRG (Rs_font, "font", "fn", "fontname", "normal text font"),

-----END OF PAGE-----