Re: FVWM: FvwmForm doesn't do color

From: Charles Hines <chuck_hines_at_VNET.IBM.COM>
Date: Mon, 19 Aug 1996 11:23:02 -0400

>>>>> "Trebor" == Trebor A Rude <trebor_at_mnsinc.com> writes:

>>> FvwmForm seems to ignore colors. I tried both lines of the form
>>> "*QuitVerifyBack blue" and "*QuitVerifyBack #0000ff" and neither
>>> work. Ditto for the foreground color and item colors. I use
>>> the line "Module FvwmForm QuitVerify" to launch it. I'm using
>>> fvwm-2.0.43 and X11R6-3.1.2E. Any suggestions?

Joey> Are you running X at >256 colors? When I run at 256 colors, it displays
Joey> stuff in color. At 16bpp, it displays all in black and white.

Trebor> Yes, I am running more than 256 colors. After all, that's the
Trebor> only way I can display my big, beautiful, 256 color .gif of
Trebor> Babylon 5 in the root window and still have enough colormap
Trebor> entries for everything else. :)

Trebor> Does the author of FvwmForm read this list? I assume this bug
Trebor> report will get back to him one way or another...

I don't know if the original author of FvwmForm is around any more or
not, but another user did contribute a patch to fix this problem to
me, and it'll be in 2.1.0 (soon).

I've included the patch to FvwmForm.c below if you'd like to try it
now (no lines, no waiting).

Chuck

----------------------------------------------------------------------
--- FvwmForm.c.orig Thu Jun 27 11:06:05 1996
+++ FvwmForm.c Tue Jul 23 09:01:25 1996
_at_@ -604,14 +604,74 @@
 /* allocate color cells */
 void GetColors ()
 {
+ Visual* visual = DefaultVisual(dpy, screen);
   XColor xc_item;
   int red, green, blue, tmp1, tmp2 ;
   if (scr_depth < 8) {
     colors[c_back] = colors[c_itemback] = WhitePixel(dpy, screen);
     colors[c_fore] = colors[c_itemfore] = colors[c_itemlo] = colors[c_itemhi]
       = BlackPixel(dpy, screen);
- } else if (!XAllocColorCells(dpy, d_cmap, 0,
- NULL, 0, colors, 6)) {
+ } else if (visual->class == TrueColor ||
+ visual->class == StaticColor ||
+ visual->class == StaticGray) {
+ if (XParseColor(dpy, d_cmap, color_names[c_fore], &xc_item) &&
+ XAllocColor(dpy, d_cmap, &xc_item))
+ colors[c_fore] = xc_item.pixel;
+ else
+ colors[c_fore] = BlackPixel(dpy, screen);
+
+ if (XParseColor(dpy, d_cmap, color_names[c_back], &xc_item) &&
+ XAllocColor(dpy, d_cmap, &xc_item))
+ colors[c_back] = xc_item.pixel;
+ else
+ colors[c_back] = WhitePixel(dpy, screen);
+
+ if (XParseColor(dpy, d_cmap, color_names[c_itemfore], &xc_item) &&
+ XAllocColor(dpy, d_cmap, &xc_item))
+ colors[c_itemfore] = xc_item.pixel;
+ else
+ colors[c_itemfore] = BlackPixel(dpy, screen);
+
+ if (XParseColor(dpy, d_cmap, color_names[c_itemback], &xc_item) &&
+ XAllocColor(dpy, d_cmap, &xc_item))
+ colors[c_itemback] = xc_item.pixel;
+ else
+ colors[c_itemback] = WhitePixel(dpy, screen);
+
+ if (XParseColor(dpy, d_cmap, color_names[c_itemback], &xc_item)) {
+ red = (int) xc_item.red ;
+ green = (int) xc_item.green ;
+ blue = (int) xc_item.blue ;
+ xc_item.red = (60 * red) / 100 ;
+ xc_item.green = (60 * green) / 100 ;
+ xc_item.blue = (60 * blue) / 100 ;
+ if (XAllocColor(dpy, d_cmap, &xc_item))
+ colors[c_itemlo] = xc_item.pixel;
+ else
+ colors[c_itemlo] = BlackPixel(dpy, screen);
+ } else
+ colors[c_itemlo] = BlackPixel(dpy, screen);
+
+ if (XParseColor(dpy, d_cmap, color_names[c_itemback], &xc_item)) {
+ tmp1 = (14 * red) / 10 ;
+ if (tmp1 > MAX_INTENSITY) tmp1 = MAX_INTENSITY ;
+ tmp2 = (MAX_INTENSITY + red) / 2 ;
+ xc_item.red = (tmp1 > tmp2) ? tmp1 : tmp2 ;
+ tmp1 = (14 * green) / 10 ;
+ if (tmp1 > MAX_INTENSITY) tmp1 = MAX_INTENSITY ;
+ tmp2 = (MAX_INTENSITY + green) / 2 ;
+ xc_item.green = (tmp1 > tmp2) ? tmp1 : tmp2 ;
+ tmp1 = (14 * blue) / 10 ;
+ if (tmp1 > MAX_INTENSITY) tmp1 = MAX_INTENSITY ;
+ tmp2 = (MAX_INTENSITY + blue) / 2 ;
+ xc_item.blue = (tmp1 > tmp2) ? tmp1 : tmp2 ;
+ if (XAllocColor(dpy, d_cmap, &xc_item))
+ colors[c_itemhi] = xc_item.pixel;
+ else
+ colors[c_itemhi] = BlackPixel(dpy, screen);
+ } else
+ colors[c_itemhi] = BlackPixel(dpy, screen);
+ } else if (!XAllocColorCells(dpy, d_cmap, 0, NULL, 0, colors, 6)) {
     colors[c_back] = colors[c_itemback] = WhitePixel(dpy, screen);
     colors[c_fore] = colors[c_itemfore] = colors[c_itemlo] = colors[c_itemhi]
       = BlackPixel(dpy, screen);
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Mon Aug 19 1996 - 12:07:29 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST