how to MoveToDesk from WindowList?

Hi all,

I want to bring up a list of windows on all desktops and move the selected one to the current desktop.

So I tried

  Key q  		A       4  	WindowList Function MoveToDesk

which on selection results in the window moving to some apparently random desktop.


 Key q  		A       4  	WindowList Function Maximize

does what I’d expect (maximises the window where it is).

What am I missing?


It seems that you’ve defined only one desk. If so try

  Key q  		A       4  	WindowList Function MoveToPage


  Key q  		A       4  	WindowList Function MoveToDesk $[desk.n]
  • Thomas -

Thanks for you reply Thomas.

I have 1 page per desktop; I don’t have the number of desktops defined (I thought there was no requirement or facility to do this).

DeskTopSize 1x1

Your suggestions led me to play around with different ways of invoking MoveToDesk from the WinList menu, with confusing results. I ended up moving the evaluation of $[desk.n] out of the WindowList parameters and into its own function:

[code]DestroyFunc moveToCurrentDesk
AddToFunc moveToCurrentDesk

  • I Echo params are $*
  • I MoveToDesk 0 $[desk.n] $*

Key q A 4 WindowList Function moveToCurrentDesk[/code]
which works. Hurrah!

The various things I tried that led me to this were:

[code]Key 8 A S4 WindowList Function “Echo MoveToDesk 0 $[desk.n] end”

Outputs: [fvwm][Echo]: MoveToDesk 0 0 end 65011833

where 65011833 is the windowID of the selected window.

The second number ($[desk.n]) is always 0, regardless of what desktop I’m actually on.

Key 1 A S4 Echo on desk $[desk.n]

outputs desk number 0, regardless of real desk number:

DestroyFunc echoLocation
AddToFunc echoLocation

  • I Echo on desk $[desk.n]

Key 1 A 4 Function echoLocation

outputs correct desk number[/code]

I don’t really understand why the value of $[desk.n] is always 0 when evaluated in the WindowList parameter list.

Because you’re using only one desk - count starts at 0.

  • Thomas -

Sorry if I’m being thick but I don’t get this; in what way am I “using only one desk” ?
When I bring up the Windowlist it lists a number of desks (0, 1 & 2), and invocation of that echoLocation function similarly prints out 0, 1 or 2 (I constrain GotoDesk).