Subject: Re: FVWM: Determine window's Icon

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 1 Dec 2003 13:06:29 +0000

On 27 Nov 2003 23:11:39 +0000, Andy Arbon wrote:
> 
> Mikhael Goikhman wrote:
> >>Excuse me for butting in, but I thought I'd give this idea a go. When I 
> >>try and use the function I get the following output on the console:
> >>import: Unable to read X window image (0x60000e).
> >>import: Missing an image filename.
> 
> >You probably didn't copy it correctly. The "+ I" should be "&&".
> 
> >>Also, I had to comment out the bottom + I Iconify, otherwise I get a 
> >>kind of 'bouncing' effect, where the window iconises and then 
> >>immediately deiconises. This could be because the former command is 
> >>failing though AFAIK.
> >It should not bounce, even if PipeRead failed.
> 
> Hello, and as usual thanks for replying Mikhael ;)
> 
> Apologies about the incorrect line. It was correct to start with, but
> probably got mucked up at some point when I was trying to work out the
> problem. I have corrected it, but still get the original problem,
> complete with the above error message and 'bouncing'.
> 
> DestroyFunc IconifyWithScreenshot
> AddToFunc IconifyWithScreenshot
> + I echo "Iconnify running"
> + I Raise
> + I PipeRead "import -geometry 64 -frame -resize 64 -silent -window
> $[w.id] $[HOME]/.fvwm/icon.tmp.$[w.id].png \
> && echo WindowStyle IconOverride, Icon $[HOME]/.fvwm/icon.tmp.$[w.id].png \
> || echo Nop"
> + I Iconify

This function alone works well when called as "Pick IconifyWithScreenshot".

But you can't use it in the iconify event of FvwmEvent, because the event
is called after the iconification is done. You probably expected that the
event _replaces_ the internal iconification. The event is only an add-on.
Think about this, in the event function itself you can't use Iconify
command, like you do here, otherwise it will trigger an iconify event
again (in this case it triggers deiconify, because the window is already
iconified).

Either fill a feature request about "preiconify" event or explicitelly
call this function instead of Iconify.

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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Tavis Ormandy <[email-masked]>
Date: Tue, 2 Dec 2003 14:32:05 +0000

I dont know if anyone else saw this

http://slashdot.org/article.pl?sid=03/11/25/0330208

I've been trying to make something similar for fvwm using this method,
this is what I've got so far, I have no idea how to restore layer after
the Raise, if anyone has any suggestions..

DestroyFunc FvwmExpose
AddToFunc FvwmExpose
+ I DestroyMenu FvwmExposeMenu
+ I AddToMenu FvwmExposeMenu ".: e x p o s e :." Title
+ I All (!Iconic !Shaded CurrentPage AcceptsFocus) \
    PipeRead "echo Raise; \
        xwd -silent -id $[w.id] | convert -resize 64 -frame 1x1 \
        -mattecolor white -quality 0 xwd:- \
        png:$[HOME]/.fvwm/icon.exp.$[w.id].png \
    && echo AddToMenu FvwmExposeMenu \
    %$[HOME]/.fvwm/icon.exp.$[w.id].png%\\\'$[w.name]\\\' WindowID $[w.id] WarpToWindow 5p 5p \
    	&& echo AddToMenu FvwmExposeMenu \\\"\\\" Nop \
	|| Nop"
+ I PopUp FvwmExposeMenu
+ I All (!Iconic !Shaded CurrentPage AcceptsFocus) \
    PipeRead "echo Exec exec rm -f $[HOME]/.fvwm/icon.exp.$[w.id].png"

I've discovered that the fastest method for getting screenshots is using
xwd as above, although it wont get the frame :(

taviso@insomniac:~$ time import -silent -resize 64 -window 0x2c00003 test.png

real    0m0.962s
user    0m0.120s
sys     0m0.010s
taviso@insomniac:~$ time xwd -silent -id 0x2c00003 | convert -resize 64 xwd:- png:test.png

real    0m0.176s
user    0m0.095s
sys     0m0.025s

Screenshot: http://dev.gentoo.org/~taviso/fvwm_expose.png

It's not that useful yet, but it feels close :)

-- 
-------------------------------------
[email-masked] | finger me for my gpg key.
-------------------------------------------------------
--
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].