Subject: Re: recent decoration bugs

From: Dominik Vogt <[email-masked]>
Date: Thu, 1 Mar 2001 17:26:53 +0100

On Wed, Feb 28, 2001 at 10:30:28AM -0600, Mikhael Goikhman wrote:
> On 28 Feb 2001 10:53:05 +0100, Olivier Chapuis wrote:
> > 
> > Mikhael Goikhman wrote:
> > > 
> > > There are 2 recent problems with the current decoration code.
> > > Here is how to reproduce them with fvwm-themes.
> > > 
> > > Load @migo (or @default) basic look.
> > > 
> > > 1) Load colors@osx. The hilight/shadow colors of the focused title buttons
> > > are incorrect. The shadow color is even lighter than the hilight one.
> > 
> > Seems that we have to fix this in fvwm-themes.
> > 
> > > 2) Load colors@redmond98 (the cvs version is good for this).
> > > The unfocussed borders are drawn incorrectly. They are autofixed after
> > > focusing/unfocusing or shading/unshading.
> > 
> > This work fine for me too. Which windowstyle do you use?
> 
> I consistently reproduce this with windowlook@deault or windowlook@migo.
> 
> I still think these are fvwm bugs, because I tried the same with
> fvwm-2.3.22 and it worked as expected (i.e. correctly).

(2) Is probably related to the new expose handling.  If in 2.3.22
the hilight/shadow colours were not reverted and the colour in
said theme did not change, then 2.3.22 was buggy.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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: Mikhael Goikhman <[email-masked]>
Date: Fri, 2 Mar 2001 05:26:48 -0600

> are incorrect. The shadow color is even lighter than the hilight one.

This may be related to the following problem. If it will not be fixed by
fixing the next one, I will provide a minimal rc file for this problem too.

> focusing/unfocusing or shading/unshading.

Here is a minimal rc file to reproduce incorrect borders on (Re)capture.
You may save it in ~/.fvwm/test/7 and then: Restart fvwm2 -f test/7
I hope you may reproduce this, otherwise I will send scrrenshots.

ModuleSynchronous FvwmTheme
# any color may be used instead of rgb:B0/00/00, for example: navy
*FvwmTheme: Colorset 3 fg white, bg rgb:B0/00/00
Style "*" BorderColorset 3

# BTW, for some reason the following All does not remove old windows
All (Test*) Close
Exec xterm -name Test1 -g 80x12+300+0
Wait Test1
Exec xterm -name Test2 -g 80x12+500+200
Wait Test2
FvwmConsole -g +200+500

# All unfocussed windows now have incorrect hilight border colors.
# If there are old mapped window they may be captured correctly...

# This fixes border colors of one of the window
All (Test2) WindowShade 
All (Test2) WindowShade

# This makes the borders buggy again
All (Test2) RecaptureWindow

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 2 Mar 2001 07:11:17 -0600

On 01 Mar 2001 17:26:53 +0100, Dominik Vogt wrote:
> 
> If in 2.3.22 the hilight/shadow colours were not reverted and the colour
> in said theme did not change, then 2.3.22 was buggy.

No, the hilight/shadow colors in 2.3.22 were correct for extreme colors.
Now - not always. The shadow color can't be lighter than the hilight one.
And not only this, they are almost the same in this case.

  *FvwmTheme: Colorset 6 bg Blue3
  Echo $v bg=$[bg.cs6] hi=$[hilight.cs6] sh=$[shadow.cs6]

[FVWM][Echo]:  2.3.22 compiled on...
	bg=rgb:0000/0000/cdcd hi=rgb:7f7f/7f7f/e6e6 sh=rgb:4c4c/4c4c/dcdc

[FVWM][Echo]:  2.3.29 compiled on...
	bg=rgb:0000/0000/cdcd hi=rgb:7373/7373/e4e4 sh=rgb:7f7f/7f7f/e6e6

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 2 Mar 2001 16:42:08 +0100

> Now - not always. The shadow color can't be lighter than the hilight one.

No, you are wrong.  The shadow colour *can* be lighter than the
hilight colour.  This was always intended by the calculation
algorithm.

> 	bg=rgb:0000/0000/cdcd hi=rgb:7373/7373/e4e4 sh=rgb:7f7f/7f7f/e6e6

Well, that's a real problem.  The reversed hilight colour should
be 60% darker than the shadow colour.  I see it's caused by a
typo: GetShadowOrHilightColor was called with PCT_LIGHT_BOTTOM
as second *and* third parameter.  The third one should have been
PCT_LIGHT_TOP.

Uh, and well, the second parameter should have been PCT_DARK_TOP
in the first place and the third parameter when calculating the
shadowe colour should have been PCT_LIGHT_BOTTOM.

Well, you're right that the colours have changed between 2.3.22
and 2.3.29, but I still think the reversed look was intended in
the first place.  So, I'll revert back to the 2.3.22 calculations,
but are these the correct ones?

Bye

Dominik ^_^  ^_^

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 2 Mar 2001 13:43:16 -0600

> hilight colour.  This was always intended by the calculation

A good sense tells that the shadow color can never be lighter than the
hilight one, otherwise a raised box would look sunk. I think this is true
for the original motif calculations, at least this is what I get with:

  Netscape*background:                    rgb:e4/d2/c0
  ! Comment GTK-like colors to get the default motif ones:
  !   topShadowColor = rgb:b7/a8/9a, bottomShadowColor = rgb:7d/73/6a
  ! As you can guess, I like the GTK-like ones.
  !Netscape*topShadowColor:               rgb:f8/f7/f6
  !Netscape*bottomShadowColor:            rgb:b1/93/75

Can you give an example when the shadow (it's named bottomShadow in motif)
color is lighter then the hilight one in our previous calculations?

> but are these the correct ones?

You didn't really reverted back. The light and dark parameters are
reversed, so the following fix is needed (please do it):

   return GetShadowOrHiliteColor(
-    background, PCT_DARK_BOTTOM, PCT_LIGHT_BOTTOM, DARKNESS_FACTOR);
+    background, PCT_LIGHT_BOTTOM, PCT_DARK_BOTTOM, DARKNESS_FACTOR);

   return GetShadowOrHiliteColor(
-    background, PCT_DARK_TOP, PCT_LIGHT_TOP, BRIGHTNESS_FACTOR);
+    background, PCT_LIGHT_TOP, PCT_DARK_TOP, BRIGHTNESS_FACTOR);

With this patch applied, the first problem in this thread is fixed.
The second problem is already fixed, thank you.

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 3 Mar 2001 14:54:33 +0100

> color is lighter then the hilight one in our previous calculations?

I'd rather stop thinking about this now :-)  I hate all these
colour calculations.  Why can't our users stick with flat
decorations?  :-)

> The second problem is already fixed, thank you.

Done.

Bye

Dominik ^_^  ^_^