Subject: FVWM: Saving Windows: save stacking order?

From: Rusty Phillips <[email-masked]>
Date: Thu, 01 Jul 2004 07:43:29 -0500

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 @a, { id => $[w.id],
x=> $[w.x], y=> $[w.y], width=> $[w.width], height=>$[w.height]}

DestroyFunc RestorePos
AddToFunc RestorePos
+ I eval foreach (@a) { cmd("WindowID $_->{id} Iconify Off"); \
 cmd("WindowID $_->{id} ResizeMove frame $_->{width}p $_->{height}p
$_->{x}p $_->{y}p"); }; \
@a=();

DestroyFunc SaveorRestore
AddToFunc SaveorRestore
+ I eval if(!($b eq "$*")) { $b="$*"; @a=(); }; \
         if(scalar @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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Scott Smedley <[email-masked]>
Date: Sun, 11 Jul 2004 03:48:50 +1000

Hi Mikhael, :)

> Is there a way to get this ...

I'd like to be able to do this as well. Do you know of a way?
I notice there is a "layer" parameter, but I don't know of a way to
determine the stacking order for windows in the same layer.

SCoTT. :)

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 10 Jul 2004 23:25:24 +0000

> determine the stacking order for windows in the same layer.

Currently M_RESTACK is the only event with periodical format, and it is
not fully supported by perllib yet. So, you can't get the stacking info
yet. But there is nothing inherently difficult to implement such
periodical format parsing, I just didn't have a need for this event yet.

Regards,
Mikhael.

---

From: Scott Smedley <[email-masked]>
Date: Sun, 11 Jul 2004 20:08:06 +1000

Hi Mikhael, :)

> periodical format parsing, I just didn't have a need for this event yet.

I'm not sure what you mean by "periodical format". Can you please elaborate?

I notice there are only 3 fields in an M_RESTACK event:

win_id
ptr, &
frame_id

I can't find a logical connection b/w those fields & a way to calculate
the stacking order.

SCoTT. :)

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 11 Jul 2004 17:01:16 +0000

> I can't find a logical connection b/w those fields & a way to calculate

These 3 arguments are repeated for all windows participated in restack.
So there are actually 3*number_of_windows arguments in M_RESTACK event.

You are right, the meaning of the windows is not documented well, just
briefly, in http://fvwm.org/documentation/dev_modules.php#M_RESTACK .
You should figure out yourself how to use this to get the stacking order.

I will either implement the generic support for events with periodical
arguments (more likely), or provide the special M_RESTACK interface.

Regards,
Mikhael.