Sorry, missing attachement included.
P.

On Fri, 8 Oct 2010 11:39:28 +0200
Pavel Vávra <[email protected]> wrote:

> On Thu, 7 Oct 2010 23:07:28 +0100
> Thomas Adam <[email protected]> wrote:
> 
> > On Thu, Oct 07, 2010 at 11:17:35PM +0200, Pavel Vávra wrote:
> > > Hi,
> > 
> > >   thank you for your fast, clear and short answer. I am going to wait next
> > >   8 years ... and then ask again :-) <--just kidding. Well, I'll try to
> > >   find a way with existing tools.  Just a sub-question from another point
> > >   of view: is any possibility to run *anything* just before window loose
> > >   its focus? I have an idea to create a window shot just before it is
> > >   unfocussed and use this picture later, when expose will be required.
> > 
> > Not "just before", no, as the event that's triggered when there's a loss of
> > focus, or the pointer leaves the window, happens at the time when the window
> > can only lose focus.
> > 
> > What is it you're trying to do?
> 
> My idea is to collect windowshots and use it later as icons in expose 
> function, i.e. run xwd as firs action when window looses its focus. To better 
> explaining I'll attach my source based on existing implementation. It is not 
> clean code, just early alpha developoment. Please ignore all non-english 
> comments. When I try to make windowshots  now, it has some "bugs", relevant 
> one is described below:
> 
> + I PipeRead "echo Raise ; xwd <etc.>  "
>     reports error for windows on non-visible page of virtual screen
> 
> + I PipeRead "echo Focus ; echo Raise ; xwd <etc.> "
>     will make windowshots for all windows, but some windows are not properly 
> drawn, it needs some time to refreshing them and I do not know how to wait 
> for it (and I do not like constants like "wait 2 seconds", the better way is 
> when window reports "OK, I am redrawn just now")
> 
> So my idea is to display windowshot from the time when focus is going to 
> another window - it is good approach (at least for me) to find this window 
> later on list.
> 
> It will eliminate other 2 bugs - flickering of screen done by sequence of 
> Raise functions and too looooong time to prepare all windowshots for menu.
> 
> 
> Pavel
> 
> > 
> > -- Thomas Adam
> > 
> > -- 
> > "Deep in my heart I wish I was wrong.  But deep in my heart I know I am
> > not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)
> > 
> > 
> 
# Notes:
#
# convert: see
# http://www.imagemagick.org/script/convert.php
# http://www.imagemagick.org/script/command-line-options.php
#

# ToDo/Check:
#
# (1)
# Pokusit se použít dvojici funkcí:
# ResizeMoveMaximize $[w.width]p $[w.height]p +0 +0  (posunutí okna na 
specifikovanou pozici - 0 0?)
# ....
# tady bude sada Raise ... xwd ...
# ....
# Maximize false  (návrat)
#
# Pozor!!! Pro viditelná okna nedělat ResizeMoveMaximize, to bude zbytečně 
zdržovat!
#
# (2)
# zkusit použít něco jako 5> místo souboru expmenu
#
# (3) zkusit vyrobit "rolovací" menu 



DestroyMenuStyle expmenu
MenuStyle expmenu MouseWheel ScrollsMenu, PopupOffset 0 0

DestroyFunc MkExpMenuItem
AddToFunc MkExpMenuItem
+ I PipeRead "echo Focus && echo Raise && \
        xwd -silent -id $[w.id] | convert -scale x96 -quality 0 xwd:- \
        png:/tmp/fvwm.exp.$[USER]/icon.$[w.id].png \
    && echo AddToMenu FvwmExposeMenu \\\"\\\" Nop >> 
/tmp/fvwm.exp.$[USER]/expmenu \
    && echo AddToMenu FvwmExposeMenu \
    %/tmp/fvwm.exp.$[USER]/icon.$[w.id].png%\"$[w.name]\" WindowID $[w.id] 
WindowListFunc >> /tmp/fvwm.exp.$[USER]/expmenu \
    || Nop"


#####
# FvwmExpose (main function)
###########

DestroyFunc FvwmExpose
AddToFunc FvwmExpose
+ I Exec exec mkdir -p -m700 /tmp/fvwm.exp.$[USER]
+ I DestroyMenu FvwmExposeMenu
+ I AddToMenu FvwmExposeMenu "e x p o s e" Title
+ I + DynamicPopDownAction Exec exec rm -f /tmp/fvwm.exp.$[USER]/*
+ I All Reverse (!Iconic, !Shaded, AcceptsFocus, !CirculateHit) MkExpMenuItem
#+ I Raise
+ I Piperead "tac /tmp/fvwm.exp.$[USER]/expmenu"
+ I ChangeMenuStyle expmenu FvwmExposeMenu 
+ I Popup FvwmExposeMenu


# Original version (not working in 2.5.26):
#DestroyFunc FvwmExposeOriginal
#AddToFunc FvwmExposeOriginal
#+ I AddToMenu FvwmExposeMenu "e x p o s e" Title
#+ I + DynamicPopDownAction DestroyMenu FvwmExposeMenu
#+ I All (!Iconic !Shaded AcceptsFocus)\
#    PipeRead "echo Raise; \
#        xwd -silent -id $[w.id] | convert -scale $$(($[w.width]/10)) -quality 
0 xwd:- \
#       png:$[fvwm_home]/tmp/icon.exp.$[w.id].png \
#   && echo AddToMenu FvwmExposeMenu \
#   %$[fvwm_home]/tmp/icon.exp.$[w.id].png%\\\'\"$[w.name]\"\\\' WindowID 
$[w.id] WarpToWindow 50 50 \
#       && echo AddToMenu FvwmExposeMenu \\\"\\\" Nop \
#   || Nop"
# Popup FvwmExposeMenu
# I Exec exec rm -f $[fvwm_home]/tmp/icon.exp.*

Attachment: pgp61gbwiv4MT.pgp
Description: PGP signature

Reply via email to