Re: FVWM: Best way to control icon placement when windows are iconified

2010-07-21 Thread Thomas Adam
On Wed, Jul 21, 2010 at 09:54:12PM +0100, Thomas Adam wrote:
> On Wed, Jul 21, 2010 at 04:39:26PM -0400, Chris Siebenmann wrote:
> >  I am currently using a somewhat hacked version of fvwm 2.4.20 and I
> > would like to move to fvwm 2.5.x (for whatever x is current when I get
> > all of the pieces working). One of the stumbling blocks is duplicating
> > one piece of icon placement behavior in my current setup.
> > 
> >  I do not have an icon box ('Style * IconBox none'). How I want icon
> > placement to work is this:
> 
> Why?  Just let it be the default (which is the whole screen).
> 
> > - when a window is iconified for the first time (and does not have any
> >   sort of icon placement specified), the icon is put right under the
> >   mouse cursor.
> 
> You can do this with a state, windowstyle, and FvwmEvent.  Here's a rough
> outline -- oh, and it assumes 2.5.X, since you can't do this at all easily
> on 2.4.X.  Good luck.
> 
> # All windows, regardless, get state 1 which is removed when iconified.
> Style * State 1
> 
> DestroyModuleConfig A:*
> *A: iconify SomeFunc
> *A: deiconify SomeOtherFunc
> 
> AddToFunc StartFunction I Module FvwmEvent A
> 
> DestroyFunc A
> AddToFunc A
> + I ThisWindow (State 1) MoveIconWindow
> + I TestRc (NoMatch) Break
> 
> DestroyFunc MoveIconWindow
> AddToFunc   MoveIconWindow
> + I Move m+0 m+0
> + I ... (other things?)
> 
> DestroyFunc SomeOtherFunc
> AddToFunc   SomeOtherFunc
> + I ThisWindow (State 1) WindowStyle 1 False

s/1/State &/

-- 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.)



Re: FVWM: Best way to control icon placement when windows are iconified

2010-07-21 Thread Thomas Adam
On Wed, Jul 21, 2010 at 04:39:26PM -0400, Chris Siebenmann wrote:
>  I am currently using a somewhat hacked version of fvwm 2.4.20 and I
> would like to move to fvwm 2.5.x (for whatever x is current when I get
> all of the pieces working). One of the stumbling blocks is duplicating
> one piece of icon placement behavior in my current setup.
> 
>  I do not have an icon box ('Style * IconBox none'). How I want icon
> placement to work is this:

Why?  Just let it be the default (which is the whole screen).

> - when a window is iconified for the first time (and does not have any
>   sort of icon placement specified), the icon is put right under the
>   mouse cursor.

You can do this with a state, windowstyle, and FvwmEvent.  Here's a rough
outline -- oh, and it assumes 2.5.X, since you can't do this at all easily
on 2.4.X.  Good luck.

# All windows, regardless, get state 1 which is removed when iconified.
Style * State 1

DestroyModuleConfig A:*
*A: iconify SomeFunc
*A: deiconify SomeOtherFunc

AddToFunc StartFunction I Module FvwmEvent A

DestroyFunc A
AddToFunc A
+ I ThisWindow (State 1) MoveIconWindow
+ I TestRc (NoMatch) Break

DestroyFunc MoveIconWindow
AddToFunc   MoveIconWindow
+ I Move m+0 m+0
+ I ... (other things?)

DestroyFunc SomeOtherFunc
AddToFunc   SomeOtherFunc
+ I ThisWindow (State 1) WindowStyle 1 False

... which is far from idea -- something would have to set the state of the
window to state 1 again if the placement of the icon was to go back to
being under the mouse (unless the window was then subsequently closed
anyway.  YMMV.)

> - when a window is iconified after that, the icon reappears wherever
>   it was last.

See above.

>  I can see how to use a user function to handle the first-time icon
> placement (I think; just use a function that does Iconify + Move to
> $[pointer.x] $[pointer.y]), but the bit I'm stuck on is how to get icons
> to stay where they are after that. Is there a conditional or a command
> that would apply for this?

See above.

> (It looks like $[i.x] et al are only defined if the window is iconified,
> so one can't abuse them to determine whether the icon has already been
> positioned somewhere before the Iconify happens.)

See above.

>  The other option is that I could add a new conditional that tests on
> IS_ICON_MOVED() et al; would people find such a patch generally useful
> and interesting for the main line code?

No thanks.  Not for 2.4.0, and not for 2.5.X, FVWM's in a feature freeze,
and 2.4.X receives no new features anyway.

See above.  :)

-- 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.)