Re: FVWM: letting fvwm do something in the background

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Sat, 10 Jan 2004 18:16:03 +0000

On 10 Jan 2004 18:01:31 +0100, Marcus Lundblad wrote:
>
> On Sat, 10 Jan 2004, Klaus Umbach wrote:
>
> > On Sa, Jan 10, 2004 at 11:11:26 -0500, Dan Espen wrote:
> > > Klaus Umbach <Klaus.Umbach_at_doppelhertz.homelinux.org> writes:
> > > > Hello list,
> > > > is it possible, to let fvwm do something in the background?
> > > > With the help of Tavis Ormandy, I have a nice function now, to have
> > > > a thumbnail of an iconified window for the icon. It really looks
> > > > beautiful, but it takes some time, to iconify a fullscreen-window (2-3
> > > > secs!).
> > > > While fvwm is working on that thumbnail-function, I cannot do anything,
> > > > is it possible, put it in the background, so I don't have to wait
> > > > anymore, until I can work?
> > >
> > > Search the man page for "Schedule".
> >
> > No, that doesn't help, I still cannot do anything while this function is
> > processed.
> >
> > DestroyFunc Thumbnail
> > AddToFunc Thumbnail
> > + I Raise
> > + I PipeRead "xwd -silent -id $[w.id] > $[HOME]/.fvwm/icon.tmp.$[w.id].xwd"
> > + I Iconify
> > + I Schedule 1000 $[w.id] PipeRead "nice -19 convert -resize 64x54 -frame 1x1 -mattecolor black -quality 0 xwd:$[HOME]/.fvwm/icon.tmp.$[w.id].xwd png:$[HOME]/.fvwm/icon.tmp.$[w.id].png && echo WindowStyle IconOverride, UseIcons, Icon $[HOME]/.fvwm/icon.tmp.$[w.id].png,StaysOnBottom || echo Nop"
>
> Try replacing "PipeRead" with "Exec".

No, just replacing will not work here. You can't Iconify until the
screenshot is taken.

You may avoid any freeze if you use this technology:

  DestroyFunc Thumbnail
  AddToFunc Thumbnail
  + I Raise
  + I Exec create-xwd; FvwmCommand 'WindowId $[w.id] Iconify on'; \
    create-png; FvwmCommand 'WindowId $[w.id] WindowStyle Icon icon.png'

(Just don't forget to run FvwmCommandS in StartFunction.)

But then the results are unpredictable, you may lower your window or move
it outside the screen and the snapshot will be broken. Or you may Iconify
the window for the second time by a mistake (using the same function
obviously), then you may have real troubles with files.

There is no way to prevent all these problems without locking, i.e.
you would better wait in PipeRead.

Regards,
Mikhael.
--
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 Sat Jan 10 2004 - 12:18:25 GMT

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