Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41969 - Patch to xrootconsole to allow it to parse RGB-colors as well as colornames.
Summary: Patch to xrootconsole to allow it to parse RGB-colors as well as colornames.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Desktop Misc. Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-17 15:58 UTC by Martin Parm
Modified: 2004-03-06 02:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
The same patch as described in the bugreport, only this is an attachment (xrootconsole-0.4.parse-color.patch,840 bytes, patch)
2004-02-17 16:00 UTC, Martin Parm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Parm 2004-02-17 15:58:27 UTC
xrootconsole used XLookupColor to parse color parameters. I changed this to XParseColor, which can parse RGB-colors in addition to colorname.
I made a patch and have spend hours trying to find some kind of information on how to submit it to the Gentoo Developers. Now I post it here, well knowing that I will probably be ignored or flamed for not following the right procedure.


diff -u xrootconsole-0.4/util.c xrootconsole-0.4.new/util.c
--- xrootconsole-0.4/util.c     2000-10-10 04:17:53.000000000 +0200
+++ xrootconsole-0.4.new/util.c 2004-02-17 23:59:45.000000000 +0100
@@ -53,16 +53,16 @@
 
 
 unsigned long load_color(const char* s, Display *dpy) {
-    XColor ce, cs;
+    XColor ce;
     Colormap colormap = DefaultColormap(dpy, DefaultScreen(dpy));
 
-    if (XLookupColor(dpy, colormap, s, &ce, &cs)) {
+    if (XParseColor(dpy, colormap, s, &ce)) {
         if (XAllocColor(dpy, colormap, &ce)) return ce.pixel;
        
         fprintf(stderr, "Warning: could not allocate color\n");
         return WhitePixel(dpy, DefaultScreen(dpy));
     }
 
-    fprintf(stderr, "Warning: could not lookup color\n");
+    fprintf(stderr, "Warning: could not parse color\n");
     return WhitePixel(dpy, DefaultScreen(dpy));
 }




Reproducible: Always
Steps to Reproduce:
1.) xrootconsole -bg '#bbbbff'
Actual Results:  
Warning: could not lookup color

Expected Results:  
The program should parse the color. That is what my patch fixes.
Comment 1 Martin Parm 2004-02-17 16:00:06 UTC
Created attachment 25808 [details, diff]
The same patch as described in the bugreport, only this is an attachment
Comment 2 Markus Nigbur (RETIRED) gentoo-dev 2004-03-06 02:12:06 UTC
in cvs.