Re: FVWM: StaysOnTop in Window Ops

From: Dominik Vogt <dominik.vogt_at_gmx.de>
Date: Sun, 21 Jul 2002 22:46:15 +0200

On Sat, Jul 20, 2002 at 09:35:34PM +0000, Mikhael Goikhman wrote:
> On 20 Jul 2002 22:10:07 +0200, Dominik Vogt wrote:
> >
> > On Sat, Jul 20, 2002 at 03:25:12PM +0000, Mikhael Goikhman wrote:
> > > On 20 Jul 2002 16:51:35 +0200, Christoph Claus wrote:
> > > >
> > > > 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
> > > + "StaysOnTop" StyleAndRecapture $n StaysOnTop
> > > + "StaysPut" StyleAndRecapture $n StaysPut
> > > + "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.
> >
> > 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.
>
> The question is why "Style X Layer 6" is not applied immediately at the
> 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.
>
> > > 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
> >
> > 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
>
> 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.

Make it a function:

  + "StaysOnTop" ChangeLayerAndStyle "$n" 6

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

> > 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.
>
> I think I knew more cases when Recapture is required, but here are four.

With the UseStyle and UseDecor stlyes.

> 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

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

> 3) If you have for example, Style "user_at_host" Sticky, and this title
> "user_at_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.

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

> 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.

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

> > Recapture = buggy, inefficient, stupid, visually disturbing... (I
> > could continue ranting about it forever).
>
> No problems, but it solves several cases, removing it is not an
> immediate option.

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

Bye

Dominik ^_^ ^_^

 --
Dominik Vogt, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sun Jul 21 2002 - 16:01:59 BST

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