Re: FVWM: letting fvwm do something in the background

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Mon, 12 Jan 2004 12:08:30 +0000

On 12 Jan 2004 09:50:36 +0100, Dominik Vogt wrote:
>
> On Sat, Jan 10, 2004 at 06:16:03PM +0000, Mikhael Goikhman wrote:
> > 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.
>
> But only taking the screenshot has to be done synchronously. Try
>
> DestroyFunc Thumbnail
> AddToFunc Thumbnail
> + I Raise
> + I PipeRead "xwd -silent -id $[w.id] \
> > $[HOME]/.fvwm/icon.tmp.$[w.id].xwd"
> + I Iconify
> + I Exec FvwmCommand 'WindowId $[w.id] Iconify on'; \
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> create-png; \
> FvwmCommand 'WindowId $[w.id] WindowStyle Icon icon.png'

For the sake of correctness, the marked part above should be removed.
It is important to do "Iconify" in the function and not in Exec to avoid
the double-iconify-corrupts-files problem. And to hope that Exec is
finished before the user deiconifies/iconifies the window again to avoid
the same problem.

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 Mon Jan 12 2004 - 06:10:55 GMT

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