Thanks to some help from Mikhael Goikhman (you saw those e-mails), I
have created these nice little functions to save and restore window size
and positions (listed at bottom). One could use these in conjunction
with another command that totally alters everything about the Windows in
order to toggle between them.
For example, I use it to tile and untile windows with this (after
loading FvwmRearrange)
Key v A 5 SaveorRestore FvwmRearrange -tile 0 0 0 0
The only thing I can't save (well...there's a lot of things, but the one
I'm worried about) is stacking order.
Is there a way to get this and restore it? For that matter, is there a
way to get every piece of data that the Window manager manages about a
single window?
By the way, I might add that I created this as a module as well. It
ended up being 68 lines of code and was about the same size as FvwmPerl
in memory. It seems that FvwmPerl is the way to go unless you're making
something REALLY huge.
DestroyFunc SavePos
AddToFunc SavePos
+ I All (!Iconic, CurrentPage, !Sticky) eval push _at_a, { id => $[w.id],
x=> $[w.x], y=> $[w.y], width=> $[w.width], height=>$[w.height]}
DestroyFunc RestorePos
AddToFunc RestorePos
+ I eval foreach (_at_a) { cmd("WindowID $_->{id} Iconify Off"); \
cmd("WindowID $_->{id} ResizeMove frame $_->{width}p $_->{height}p
$_->{x}p $_->{y}p"); }; \
_at_a=();
DestroyFunc SaveorRestore
AddToFunc SaveorRestore
+ I eval if(!($b eq "$*")) { $b="$*"; _at_a=(); }; \
if(scalar _at_a) { cmd("RestorePos");} \
else { cmd("SavePos"); cmd("$*");};
--
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 Thu Jul 01 2004 - 07:31:59 BST