Subject: [[email-masked]: Re: FVWM: Changing Decor in a Function]

From: [email-masked] (Albrecht Kadlec)
Date: Tue, 21 Jan 97 14:00:00 +0100

=> From: lar3ry gensch <[email-masked]>
=> Subject: Re: FVWM: Changing Decor in a Function
=> 
=> Martin Cartwright wrote:
=> > 
=> > if STICKY:
=> >         Stick
=> >         ChangeDecor "Default"
=> > else
=> >         Stick
=> >         ChangeDecor "stickydecor"
=> > endif
=> 
=> Add these lines to your .fvwm2rc file:
=> 
=> #########################################################
=> DestroyFunc	SwitchDecor
=> AddToFunc	SwitchDecor
=> + "I"	StickyDecor
=> 
=> DestroyFunc	StickyDecor
=> AddToFunc	StickyDecor
=> + "I"	ChangeDecor	"Sticky"
=> + "I"	DestroyFunc	SwitchDecor
=> + "I"	AddToFunct	SwitchDecor "I" DefaultDecor
=> 
=> DestroyFunc	DefaultDecor
=> AddToFun	DefaultDecor
=> + "I"	ChangeDecor	"Default"
=> + "I"	DestroyFunc	SwitchDecor
=> + "I"	AddToFunct	SwitchDecor "I" StickyDecor
=> 
=> ChangeDecor	"Default"
=> #########################################################
=> 
=> When you want to toggle from one to another, just execute SwitchDecor.

M> I've also noticed something else. You can't make two windows sticky 
M> one after the other and change the decor at the same time as making the 
M> first one sticky switches the SwitchDecor function to revert to the default
M> decor. So if you try and make a second window change decor, it becomes sticky
M> but keeps the default decor. This could get kind of confusing. 

M> I'm going to make one of my outlandish non-programmer type 
M> suggestions here:

M> Currently sticky windows have those nice grooves along the title bar
M> so presumably some bit of code somewhere recognizes the fact that 
M> it's sticky and slaps them over the top regardless of decor. Would it 
M> be possible to adapt this to pick up a Decor at the same time. This could 
M> be a reserved Decor called "Sticky" which unless defined is the same as 
M> "Default" but with the grooves. However, if defined by the user, any window 
M> that becomes sticky, picks up the new decor (and the grooves), and then reverts when unstuck. This could be just a colour change, or something really poncy, 
M> depending upon the user.

M> Ridiculous suggestion over.

not so ridiculous, but I'd like sth more general, or we'll soon have
hundreds of special reserved style names.

a programmer suggestion: 
implement an "if" function like the prev/next/none

or perhaps you can use sth like 

AddToFunction MyStickFunction	Stick
+	Next [windowid $w, sticky] ChangeDecor "Sticky"
+	Next [windowid $w, !sticky] ChangeDecor "Default"
	
(Chuck: this was in my 2.0.43 monster patch at some time - remember ?)

albrecht

PS: I'm working on making the event mask for FvwmAuto configurable.
    This makes FvwmAuto a general hook function:

	FvwmAuto Mask timeout Enterfn LeaveFn

normal auto-raise is:
	FvwmAuto focus 300 Raise Nop

other uses:
	FvwmAuto "Iconify|Destroy|AddWindow" 0 "FvwmTile -h 10 10 90 90"
 	( re-tile, if window-layout changed )

	FvwmAuto "Raise|Lower" 0 "FvwmCascade -h 10 10 90 90"
 	( re-cascade, if stacking-order changed )
	
only problem: the event mask doesn't offer much more options.
Where do I get a "Stick Event" from ? - Do I have to parse the
ConfigureWindow Event ?  (guess so, but please confirm)

If ConfigureWindow is State-information, this wouldn't be worth the effort
- I'd have to keep the old state for every window, which is sth I really
don't like to.
-- 
If the designers of X Windows built cars, there would be no fewer than
five steering wheels hidden about the cockpit, none of which followed the
same principles -- but you'd be able to shift gears with your car stareo.
Useful feature, that.
                        -- Marcus J. Ranum, Digital Equipment Corporation
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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].