summaryrefslogtreecommitdiff
path: root/zwgc/X_gram.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1989-11-30 06:22:16 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1989-11-30 06:22:16 +0000
commit441f8b833a33d7fbfcc2160a4f57b1148c0a9875 (patch)
treecf96b44289c4f6dcca7ce10f9aaddfc091b54d77 /zwgc/X_gram.c
parentedcc5ff2a90e8ab3994f89eb4791ebaef511f9d5 (diff)
recolor the cursor with pointerColor
Diffstat (limited to 'zwgc/X_gram.c')
-rw-r--r--zwgc/X_gram.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/zwgc/X_gram.c b/zwgc/X_gram.c
index e1c91b2..2ba71ad 100644
--- a/zwgc/X_gram.c
+++ b/zwgc/X_gram.c
@@ -141,6 +141,27 @@ void x_gram_init(dpy)
if (!cursor)
cursor = XCreateFontCursor(dpy, XC_sailboat);
+ temp = get_string_resource("pointerColor", "Foreground");
+ if (temp) {
+ char *temp2;
+ XColor cursor_fore, cursor_back;
+ /* XXX need to do our own parsing here, since the RecolorCursor
+ routine requires an XColor, not an unsigned long (pixel) */
+ if (!(temp2 = get_string_resource("background","Background"))) {
+ if (default_bgcolor == WhitePixelOfScreen(DefaultScreenOfDisplay(dpy)))
+ temp2 = "white";
+ else
+ temp2 = "black";
+ }
+ if (XParseColor(dpy,
+ DefaultColormapOfScreen(DefaultScreenOfDisplay(dpy)),
+ temp, &cursor_fore) &&
+ XParseColor(dpy,
+ DefaultColormapOfScreen(DefaultScreenOfDisplay(dpy)),
+ temp2, &cursor_back)) {
+ XRecolorCursor(dpy, cursor, &cursor_fore, &cursor_back);
+ }
+ }
if (!(title_name=get_string_resource("title","Title")))
if (!(title_name=get_string_resource("name","Name")))
title_name=app_instance;