Re: FVWM: That thing I said last time: asynchronous

From: Scott Smedley <scottie7_at_tpg.com.au>
Date: Wed, 7 Jul 2004 02:45:21 +1000

Hi Rusty,

> It forks off the stuff that takes a long time and renices it to the
> lowest possible priority. The downside is that there's a small chance
> it will result in not getting an icon, and or the wrong icon because
> there is only one variable to store icon captures.

I suggest putting the UseCaptured stuff in an external script (written
in bash for maximum portability, or perhaps a language you're more
familiar with?).

If you iconify multiple windows in a very short period of time, I can
see long delays occuring due to a FvwmPerl bottleneck. With an external
script, each iconify action will create a new process which should
complete (on average) a lot quicker.

There may be other ways to do it, just thought you'd appreciate
knowing what solution seemed easiest to me.

> DestroyFunc UseCaptured
> AddToFunc UseCaptured
> + I eval my $pid; $SIG{'CHLD'}='IGNORE'; if(!($pid=fork)) { \
> open(TEMP12, "|convert -scale $[fvwm_icon_size] -frame 1x1 \
> -mattecolor black -quality 0 xwd:- \
> png:$[HOME]/.fvwm/icon.tmp.$[w.id].png"); \
> print TEMP12 $e; close(TEMP12); \
> cmd("WindowId $[w.id] WindowStyle IconOverride, \
> Icon $[HOME]/.fvwm/icon.tmp.$[w.id].png, StaysOnBottom"); \
> } else { setpriority 0,$pid,19 }

What an awesome function! Fvwm, Perl & a bit of shell scripting! :)

SCoTT. :)
--
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 Tue Jul 06 2004 - 11:51:49 BST

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