Subject: FVWM: Asynchronous behaviour

From: Rusty Phillips <[email-masked]>
Date: Mon, 05 Jul 2004 06:31:49 -0500

I have a very specific problem and I'm not sure how to solve it, so I
thought I'd bring it here.

I'm trying to change the behavior of "Alt+Tab" to 
  iconify current window
  deiconify, focus, and raise next.

In and of itself, this is easy, and works fine.

The problem I get is that I'd like to use Tavis Ormandy's excellent
thumbnail creation code.  This takes two seconds to run on my machine,
so my thought was to do it in the background - actually, to do it behind
the other Window.

So I implemented this with this function:
DestroyFunc SwitchandMinimize
AddToFunc SwitchandMinimize
+ I Next Iconify off
+ I Next Focus
+ I Next Raise
+ I ThumbnailAlways

Theoretically, it should do the quick stuff first, and leave me with a
window in the foreground that I can use even during those two seconds
that the other window is being iconified.

However, it doesn't work.  Initially, the next window is deiconified,
and raised, but the first window is thumbnailed before the next window
is given focus.  How can I make this function execute the code in the
order I've included it?

--
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: Tue, 6 Jul 2004 01:46:33 +1000

Hi Rusty,

: The problem I get is that I'd like to use Tavis Ormandy's excellent
: thumbnail creation code.  This takes two seconds to run on my machine,
: so my thought was to do it in the background - actually, to do it behind
: the other Window.

I'm not sure I have the ideal solution for you, however:

The thumbnailing operation can be split into 2 parts:
1. immediate actions
2. deferred actions

Immediate actions would be stuff like raising the window, grabbing
a screenshot & then iconifying the window.

The deferred stuff (which takes most of the processing time) encompasses:
recording the current icon image, creating the thumbnailed icon image,
setting the icon image to the new thumbnail.

All the deferred stuff can be done in a script & Exec'ed. Communication
with FVWM (in the script) would be trivial with FvwmCommand.

Once FVWM does the Exec it's no longer waiting (for PipeReads) &
hopefully it will all appear much more responsive.

SCoTT. :)

---

From: Rusty Phillips <[email-masked]>
Date: Mon, 05 Jul 2004 19:26:08 -0500

Good idea; that should do the trick.  Thanks for the help.