Subject: Re: FVWM: Bug in 2.1.7 and 2.1.10 ?

From: Sam Krishnabhat <[email-masked]>
Date: Sun, 7 Feb 1999 19:05:58 -0800 (PST)

Hi,

Following is the code after the patch is applied.
I do see the arrows, but I still don't see the shade
in the arrows in the menu.

  /* calculate colors based on foreground */
  if (!ms->look.f.hasActiveFore)
    ms->look.MenuActiveColors.fore=ms->look.MenuColors.fore;
 
  /* calculate colors based on background */
  if (!ms->look.f.hasActiveBack)
    ms->look.MenuActiveColors.back = ms->look.MenuColors.back;
  if (!ms->look.f.hasStippleFore)
    ms->look.MenuStippleColors.fore = ms->look.MenuColors.back;
  if(Scr.d_depth > 2) {                 /* if not black and white */
    ms->look.MenuRelief.back = GetShadow(ms->look.MenuColors.back);
    ms->look.MenuRelief.fore = GetHilite(ms->look.MenuColors.back);
  } else {                              /* black and white */
    ms->look.MenuRelief.back = GetColor("black");
    ms->look.MenuRelief.fore = GetColor("white");
  }
  ms->look.MenuStippleColors.back = ms->look.MenuColors.back;
 
  /* make GC's */
  gcm = GCFunction|GCPlaneMask|GCFont|GCGraphicsExposures|
    GCLineWidth|GCForeground|GCBackground;
  gcv.fill_style = FillSolid;
  gcv.font = ms->look.pStdFont->font->fid;
  gcv.plane_mask = AllPlanes;
  gcv.function = GXcopy;
  gcv.graphics_exposures = False;
  gcv.line_width = 0;

> From [email-masked] Sat Feb  6 10:52:08 1999
> To: Sam Krishnabhat <[email-masked]>
> Cc: [email-masked]
> Subject: Re: FVWM: Bug in 2.1.7 and 2.1.10 ?
> 
> %% Sam Krishnabhat <[email-masked]> writes:
> 
>   >> Hmm.  So, can you paste the portion of the code that shows the patch
>   >> already in there?
> 
>   sk> Now, after applying the changes, I do see the arrows in the menu.
>   sk> But, before I used to see shaded arrows, now I see a perfect
>   sk> triangle without "button-like" shade, I am happy though.
> 
> The reason they don't look right is because you did not apply the patch
> we provided.  You merely commented out some code; that is _not_ what the
> patch we sent did.  It _replaced_ that code with an if-statement.
> 
> Please try to actually make the changes provided, and see if they fix
> your problem.
> 
> You might look and see if you have the "patch" program on your system.
> If you do, then you should feed the email into it (while in the
> fvwm/fvwm subdirectory) and it will do everything for you.
> 
> Since none of us has a system like this, it's up to you to verify the
> fix for us, or we can't confirm the change works and it has much less
> likelihood of making it into the codebase.
> 
>   sk> I applied the change as follows:-
> 
>   sk>   /* calculate colors based on background */
>   sk>   if (!ms->look.f.hasActiveBack)
>   sk>   ms->look.MenuActiveColors.back = ms->look.MenuColors.back;
>   sk>   if (!ms->look.f.hasStippleFore)
>   sk>   ms->look.MenuStippleColors.fore = ms->look.MenuColors.back;
>   sk> #if 0
>   sk>   ms->look.MenuRelief.back = GetShadow(ms->look.MenuColors.back);
>   sk>   ms->look.MenuRelief.fore = GetHilite(ms->look.MenuColors.back);
>   sk> #endif /* SAM: */
>   sk>   ms-> look.MenuStippleColors.back = ms->look.MenuColors.back;
>  
> No, that's not what you want.
> 
> You should _replace_ the two lines you commented out with these:
> 
>     if(Scr.d_depth > 2) {                 /* if not black and white */
>       ms->look.MenuRelief.back = GetShadow(ms->look.MenuColors.back);
>       ms->look.MenuRelief.fore = GetHilite(ms->look.MenuColors.back);
>     } else {                              /* black and white */
>       ms->look.MenuRelief.back = GetColor("black");
>       ms->look.MenuRelief.fore = GetColor("white");
>     }
> 
> Please try that and let us know if it looks the same as before.
> 
> -- 
> 
-------------------------------------------------------------------------------
>  Paul D. Smith <[email-masked]>         Network Management Development
>  "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
> 
-------------------------------------------------------------------------------
>    These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://fvwm.math.uh.edu/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Wed, 10 Feb 1999 09:00:52 -0500

> in the arrows in the menu.

Seeing the arrows is good.

I have some questions about the shading.

During the  debug process you changed from  your original menustyle, I
think it  was "fvwm" to  another menustyle   that  gives flat  looking
arrows.   Have you  changed your menustyle   back to fvwm?  That might
account for not seeing any shading...

I'm unclear as to  how a black and  white terminal can render any sort
of  shading.  Shading  on a color  terminal  comes from using  a light
color on one side of  an object and a darker  color on the other side.
Since you only have black and  white to work  with, I don't understand
what you mean by "shading".

Thanks for your help so far.

> --
> >  Paul D. Smith <[email-masked]>

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://fvwm.math.uh.edu/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Tim Phipps <[email-masked]>
Date: Wed, 10 Feb 1999 14:13:29 +0000

> what you mean by "shading".

You can get grey by stipling. For a black button a nice effect is white
for the top shadow and a 50/50 back/white stipple for the bottom shadow.
It's also why a shadow thickness of 2 is nice. I don't know if fvwm ever
used stipling for making greys on b&w displays though.

Cheers,
Tim.

---

From: Dan Espen <[email-masked]>
Date: Wed, 10 Feb 1999 09:17:55 -0500

> used stipling for making greys on b&w displays though.

I didn't  see any  logic  in the old  code that  put stippling  in the
arrows, so I'm still confused about the report that its missing.
Of course I could have missed the logic.  If I did, I'd like to know.

---

From: [email-masked] (Paul D. Smith)
Date: 10 Feb 1999 09:27:17 -0500

%% Dan Espen <[email-masked]> writes:

  de> I'm unclear as to how a black and white terminal can render any
  de> sort of shading.  Shading on a color terminal comes from using a
  de> light color on one side of an object and a darker color on the
  de> other side.  Since you only have black and white to work with, I
  de> don't understand what you mean by "shading".

Yes, this was my first thought, too.  I decided there must be some kind
of stippling going on.

I wonder if it has anything to do with the other code you posted about
missing:

  if(Scr.d_depth > 2)
  {
    ...
  }
  else
  {
    Scr.MenuColors.back  = GetColor(white);
    Scr.MenuColors.fore  = GetColor(black); 
    Scr.MenuRelief.back  = GetColor(black);
    Scr.MenuRelief.fore  = GetColor(white);
    Scr.MenuStippleColors.back = GetColor(white);
    Scr.MenuStippleColors.fore = GetColor(black);
  }

Offhand it doesn't look like it, but you never know...