Subject: FVWM: StaysOnTop in Window Ops

From: Christoph Claus <[email-masked]>
Date: Sat, 20 Jul 2002 12:40:32 +0200

Hi, there!

I would like to have the Style StaysOnTop in the Window-Ops Menu (where
Raise, Move, (De)Iconify etc. live), so that I could assign this Style to
every window I wish. I've tried much, but I can't figure out, how to do
that... Can You help me? Thank you

chr
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 20 Jul 2002 14:29:48 +0000

> that... Can You help me? Thank you

http://www.hpc.uh.edu/fvwm/archive/0206/msg00329.html

Regards,
Mikhael.

---

From: Christoph Claus <[email-masked]>
Date: Sat, 20 Jul 2002 16:51:35 +0200

It doesn't work for me... :-(

Regards
Christoph

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 20 Jul 2002 15:25:12 +0000

> It doesn't work for me... :-(

Ok. Several issues here.

StaysOnTop just like Layer is one of the not many style options that
require RecaptureWindow to be applied. This works in 2.4.x:

  AddToMenu MenuFvwmWindowOps
  + I "StaysOnTop"    StyleAndRecapture $n StaysOnTop
  + I "StaysPut"      StyleAndRecapture $n StaysPut
  + I "StaysOnBottom" StyleAndRecapture $n StaysOnBottom

  AddToFunc StyleAndRecapture
  + I Style "$0" $1
  + I All ("$0") RecaptureWindow

But this is broken in the current cvs, these style options do not work.

Anyway, if you want only to change layers of one specific window, not
all windows with the same name, you may do it without Style:

  AddToMenu MenuFvwmWindowOps
  + "StaysOnTop"    Layer 0 6
  + "StaysPut"      Layer 0 4
  + "StaysBottom"   Layer 0 2

Regards,
Mikhael.

---

From: Christoph Claus <[email-masked]>
Date: Sat, 20 Jul 2002 18:45:26 +0200

>   + "StaysBottom"   Layer 0 2

That works fine, thank you!

Regards, chr

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 20 Jul 2002 22:10:07 +0200

> But this is broken in the current cvs, these style options do not work.

Sure.  This doesn't work.  You have to remove the "I" bits first
;-)  ALthough it probably happened by accident, I think it is
correct that recapturing a window does not modify the window's
layer.  To do this at run time, use the layer command.  With the
same reasoning, changing the "Sticky" and "StartsIconic" styles
with Recapture should be no-ops too.  Remember, I'm still trying
to obsolete and finally remove the Recapture command.
 
>   + "StaysBottom"   Layer 0 2

Or if you want to changle the layers of all windows with the given
name:

  AddToMenu MenuFvwmWindowOps
  + "StaysOnTop"    All ($n) Layer 0 6
  + "StaysPut"      All ($n) Layer 0 4
  + "StaysBottom"   All ($n) Layer 0 2

I recommend not to promote any configs that use the Recapture
command anymore.  As far as I know, it is not recessary to update
any styles and can be avoided in all other situations too.

Recapture = buggy, inefficient, stupid, visually disturbing... (I
could continue ranting about it forever).

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" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 20 Jul 2002 21:35:34 +0000

On 20 Jul 2002 22:10:07 +0200, Dominik Vogt wrote:
> >   + "StaysOnTop"    StyleAndRecapture $n StaysOnTop
> >   + "StaysPut"      StyleAndRecapture $n StaysPut
> >   + "StaysOnBottom" StyleAndRecapture $n StaysOnBottom
> > 
> it probably happened by accident, I think it is

The question is why "Style X Layer 6" is not applied immediately at the
first place. Then it would be irrelevant whether RecaptureWindow changes
a layer or not.

>   + "StaysBottom"   All ($n) Layer 0 2

Just to make it clear that this is not the same as the Style examples that
are at the top of this message, because it only changes the layer of the
windows currently on the screen. If such window is closed and the "same"
one is open, the new one forgets the changed layer unlike Style.

> any styles and can be avoided in all other situations too.

I think I knew more cases when Recapture is required, but here are four.
The first two are used in fvwm-themes, the last two is the reason to have
Recapture and RecaptureWindow in menus:

1) + "StaysOnTop" FuncFvwmStyleAndRecapture $n StaysOnTop

2) + "Rearrange icons" All (CurrentDesk Iconic) RecaptureWindow

3) If you have for example, Style "user@host" Sticky, and this title
   "user@host" is set by a shell prompt after a window is captured, you
   need Recapture (the only way) to force this style on new terminals.

4) If not for other things Recapture is a more powerful Refresh that may
   help in discovering bugs in dynamical Style/BorderStyle/Colorset etc.
   A lot of bugs reports in 2.3.x were: X only works after a Recapture.

> could continue ranting about it forever).

No problems, but it solves several cases, removing it is not an
immediate option.

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 21 Jul 2002 22:46:15 +0200

On Sat, Jul 20, 2002 at 09:35:34PM +0000, Mikhael Goikhman wrote:
> first place.

Because someone - most likely me - thought that to change the the
layer of a window, one should use the Layer command, not the
style.  From style.c:check_window_style_change():

  /* nothing to do for these flags (only used when mapping new windows):
   *...
   *   use_layer
   *...
   */

The style would have better been named "StartsOnLayer" (along
with "StartsSticky"), augmented with
"RecaptureHonorsStartsOnLayer" and "RecaptureHonorsStartsSticky".

> Then it would be irrelevant whether RecaptureWindow changes
> a layer or not.
> 

Make it a function:

  + "StaysOnTop"    ChangeLayerAndStyle "$n" 6

AddtoFunc ChangeLayerAndStyle
+ I All ($n) Layer 0 $1
+ I Style $0 All ($n) Layer $1

> I think I knew more cases when Recapture is required, but here are four.

With the UseStyle and UseDecor stlyes.

> 1) + "StaysOnTop" FuncFvwmStyleAndRecapture $n StaysOnTop

See solution above.  No recapture necessary.

> 2) + "Rearrange icons" All (CurrentDesk Iconic) RecaptureWindow
 
Yes.  But it's really just a hack that exploits random behaviour
that was never designed this way.  It would be much better to
implement this with Place Again.

[later]

The new option "Icon" to the PlaceAgain command just places the
icon again, duplicating the effect of a recapture:

  AddToFunc DeiconifyAndRearrange
  + C Iconify off
  + C All (CurrentPage, Iconic) PlaceAgain Icon

>    need Recapture (the only way) to force this style on new terminals.

No, we don't need a recapture here.  You can simply replace the
"Recapture" with "Stick on".  No style changes needed at all.

>    A lot of bugs reports in 2.3.x were: X only works after a Recapture.

These reports would become "X only works after a restart".

> No problems, but it solves several cases, removing it is not an

No, not an immediate option, but a medium to long term goal.

Bye

Dominik ^_^  ^_^