--- rxvt-unicode/src/init.C 2014/12/13 12:24:32 1.340 +++ rxvt-unicode/src/init.C 2016/06/21 12:03:56 1.346 @@ -13,6 +13,7 @@ * Copyright (c) 1998-2001 Geoff Wing * - extensive modifications * Copyright (c) 2003-2008 Marc Lehmann + * Copyright (c) 2015 Emanuele Giaquinta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,6 +45,10 @@ #include +#ifdef HAVE_XMU +# include +#endif + #ifdef HAVE_XSETLOCALE # define X_LOCALE # include @@ -148,6 +153,31 @@ } #endif +#define NULL_5 \ + NULL, \ + NULL, \ + NULL, \ + NULL, \ + NULL, + +#define NULL_10 \ + NULL_5 \ + NULL_5 + +#define NULL_40 \ + NULL_10 \ + NULL_10 \ + NULL_10 \ + NULL_10 + +#define NULL_50 \ + NULL_40 \ + NULL_10 + +#define NULL_100 \ + NULL_50 \ + NULL_50 + static const char *const def_colorName[] = { COLOR_FOREGROUND, @@ -253,6 +283,12 @@ "rgb:b9/b9/b9", "rgb:d0/d0/d0", "rgb:e7/e7/e7", + NULL_100 + NULL_40 + NULL, + NULL, + NULL, + NULL, #else // 256 xterm colours "rgb:00/00/00", @@ -495,6 +531,10 @@ "rgb:da/da/da", "rgb:e4/e4/e4", "rgb:ee/ee/ee", + NULL_100 + NULL_100 + NULL_40 + NULL_5 #endif #ifndef NO_CURSORCOLOR @@ -1067,55 +1107,8 @@ #endif for (i = 0; i < NRS_COLORS; i++) - { - const char *name = rs[Rs_color + i]; - - if (!name) - continue; - - rxvt_color xcol; - - if (!set_color (xcol, name)) - { -#ifndef XTERM_REVERSE_VIDEO - if (i < 2 && option (Opt_reverseVideo)) - name = def_colorName [1 - i]; - else -#endif - name = def_colorName [i]; - - if (!name) - continue; - - xcol.free (this); - - if (!set_color (xcol, name)) - { - switch (i) - { - case Color_fg: - case Color_bg: - rxvt_warn ("unable to get foreground/background colour, continuing.\n"); - name = ""; - break; -#ifndef NO_CURSORCOLOR - case Color_cursor2: -#endif - case Color_pointer_fg: - name = rs[Rs_color + Color_fg]; - xcol.set (this, name); - break; - default: - name = rs[Rs_color + Color_bg]; - xcol.set (this, name); - break; - } - } - } - - pix_colors[i] = xcol; - rs[Rs_color + i] = name; - } + if (const char *name = rs[Rs_color + i]) + set_color (pix_colors [i], name); /* * get scrollBar shadow colors @@ -1256,7 +1249,7 @@ void rxvt_term::set_icon (const char *file) { -#if HAVE_PIXBUF +#if HAVE_PIXBUF && ENABLE_EWMH GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (file, NULL); if (!pixbuf) { @@ -1452,7 +1445,18 @@ 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,