FVWM CVS: PositionPlacement

There’s been an interesting and useful commit in the FVWM CVS repository today. It introduces a new style of PositionPlacement which merges the CenterPlacement and UnderMousePlacement styles, and allows for placing a window at a known position (like the commands the Move command accepts).

This has useful implications since it will mean there’s now no need to use things like:

DestroyModuleConfig a:*
*a: add_window "ThisWindow (some_window_name) Move 120 890"

You can just do:

Style some_window_name PositionPlacement 129 890

Quoting as an excerpt from the email sent to fvwm-workers:

I have removed these two styles and replaced them with the much
more general style "PositionPlacement".

Old styles


New styles

  PositionPlacement Center
  PositionPlacement UnderMouse

PositionPlacement can do a lot more.  You can give an argument
that is interpreted like the arguments of the Move command.  E.g.

  PositionPlacement -0 -0

places a window in the bottom right corner of the screen.
Furthermore I generalized the syntax of the move arguments:


Where "position" can be any string in the old syntax.  The new
suffix 'w' means percent of window size.  Any nubmer of offsets
can be given and are interpreted like this:

 <n> or +<n> or ++<n> or --<n>
   plus <n> percent of screen size

 -<n> or +-<n>
   minus <n> percent of screen size

 <n>p or +<n>p or ++<n>p or --<n>p
   plus <n> pixels

 -<n> or +-<n>
   minus <n> pixels

 <n>w or +<n>w or ++<n>w or --<n>w
   plus <n> percent of window size

 -<n>w or +-<n>w
   minus <n> percent of window size


 * Move window to center of screen

     Move 50-50w 50-50w

 * Place center of new windows at 300 500

     Style * PositionPlacement 300p-50w 500p-50w

 * Move a window down by 10% of its size + 3 pixels

     Move keep w+10w+3p

 * Move a window up by 10% of its size + 3 pixels

     Move keep w+-10w-3p

I highly recommend it. :slight_smile:

– Thomas Adam

It’s great, but can you tell me how can i move a window left/right by 10% of its size + 3 pixels, because i can’t handle it. Thanks.

Style foo PositionPlacement keep w+-10w-3p

– Thomas Adam

  1. Why remove the “old styles” ? :frowning:
    They are in the Debian etch package!
    Some users (e.g. me) might have happily used them in their config. Superfluosly frustrating, that will break on next update. (Luckily I found this Forum before :))

  2. Is it possible (sure, I guess, but how?) to do UnderMousePlacement in older fvwm?

(I don’t want to risk messing up my box by updating to the latest fvwm…)

Sorry, I don’t see how to get that BBCode ON. It is OFF, contrary to User Control Panel setting :frowning:

Because we can.

You’re running code from CVS (at the point I mentioned PositionPlacement) – things can and do change, sometimes ““breaking”” things – and that’s the caveat you take on when doing so.

– Thomas Adam

Nope, I’m not running fvwm from CVS, but from here: packages.debian.org/etch/i386/fvwm (i.e. 2.5.18).

So, I will present the world two versions of the ultimate no-that-transient popup FvwmPager. One for current Debian (Ubuntu, etc.) users, and one for future Debian users.

Do you have a suggestion regarding my question 2) above?

I haven’t yet learned the man page by heart, and not found conditionals (e.g. IF (version>2.5.18) THEN) …

Thanks for your work!

ummm, sorry, forget about my question 3) … Test (Version > 2.5.18) etc.
Slowly but surely I love tweaking that thing. If only I had more spare time!

Define “older version of FVWM” – support for UnderMousePlacement (and a patch thereof) has been floating about for some time.

– Thomas Adam

2.5.12, as in packages.debian.org/sarge/i386/fvwm (that’s my untouchable Debian testbox at work)

No – UnderMousePlacement was introduced in 2.5.17, IIRC.

– Thomas Adam

wrrr… again back to the future!

The old “UnderMousePlacement” did work perfect - but the pager had a problem.
Now I got 2.5.26, but still no perfect not-so-transient popup pager…
The pager now works again, but “UnderMousePlacement” is gone, and not identically replaced by “PositionPlacement UnderMouse”.

Quoting an unanswered mail from a fellow sufferer:

Bad! I suggest you re-introduce the old “UnderMousePlacement” code under the name “PositionPlacement UnderMouse”.

Is there a way to work around it?
I’m still no Fvwm config expert. Couldn’t do anything with “Move pointer”

What is it you’re asking, exactly?

Where is this “unanswered mail”, exactly?

Umm, it is the same.

Until you actually describe what you’re ranting about, fuck knows.

– Thomas Adam

It’s in the google :slight_smile:
Or, to use an unusable interface, try here:
mail-archive.com/fvwm@lists. … 16112.html

It now (2.5.26 from Debian lenny) works as described in said mail.
Before (dunno version, it’s erased from disk) “UnderMousePlacement” managed to get the window popped up completely on the screen:
In most cases with top left edge under the mouse, in the “special” case decribed in said mail the position got adjusted so that it is

  1. under mouse
  2. 100% on screen

I want some sort of “Style” command that makes a window 1) pop up under mouse PLUS 2) 100% on screen. (This methinks is not too much to expect of a window manager…)

Actually, I only want a decent, not-so-transient Pager, i.e., one that stays under my mouse until I leave it.
Something along these lines:

[code]Mouse 3 R A FuncTransiPager
Key Menu A A FuncTransiPager

Style FvwmPager StaysOnTop, PositionPlacement UnderMouse #UnderMousePlacement

DestroyFunc FuncTransiPager
AddToFunc FuncTransiPager

  • I KillModule FvwmPager
  • I Module FvwmPager

DestroyFunc FuncKillTransiPager
AddToFunc FuncKillTransiPager

  • I PointerWindow (!FvwmPager) KillModule FvwmPager

Module FvwmEvent
*FvwmEvent: Cmd Function
*FvwmEvent: enter_window FuncKillTransiPager
With the current “PositionPlacement UnderMouse” this is not 100% usable when mouse it at right border of screen: (Can’t give you a screenshot today, for I’m currently at the old Fvwm 2.5.12.)

Does the following patch fix this for you (i.e., work as the old behaviour?)

xteddy.org/~n6tadam/fvwm/undermo … reen.patch

Please apply this to a CVS checkout.

– Thomas Adam

Yeah, looks the patch exactly does it. But I can’t test in my present place. Test needs to wait till next week. Thanks for kicking my ass to finally have a look into the sources.

OK. But it wasn’t you who wrote the patch – I did. :stuck_out_tongue: I’m commiting this to CVS anyway.

– Thomas Adam

Oh. Still I grant you (or anybody else) to pretend to have authored the above not-so-transient FvwmPager 8)

So, it looks by next week I might encounter the first perfect window manager :smiley: (I.e. one without any superfluous mousing and clicking and no sucking bells and whistles - where work can be efficient and fun.) For that I have patiently waited for not much more than one decade. :confused:

Umm, no I very much doubt that. You have enough rope to hang yourself – and so far you’re close to it.

– Thomas Adam

OK – this is now in CVS. If you could test that – but I’m convinced it works fine.

– Thomas Adam

And furthermore is now an official part of FVWM 2.5.27.

– Thomas Adam