On Mon, Aug 17, 2009 at 12:48 PM, Thomas Adam<thomas.ada...@gmail.com> wrote: > 2009/8/16 <i...@unx.ca>: >> >> Hi.. >> >> I've written a function to swap the windowson one screen with the >> windows on another screen in a xinerama setup. It works, but its not >> ideal >> >> DestroyFunc SwapScreens >> AddToFunc SwapScreens >> + I All (CurrentPage) MoveToPage 9 0 >> + I GotoPage 9 0 >> + I All (CurrentPage) PipeRead "$[HOME]/.fvwm/MoveToScreenAndWarp.sh $[w.x]" >> + I GotoPage 0 0 >> + I All (CurrentPage, AnyScreen) PipeRead >> "$[HOME]/.fvwm/MoveToScreenAndWarp.sh $[w.x]" >> + I GotoPage 9 0 >> + I All (CurrentPage, AnyScreen) MoveToPage 0 0 >> + I GotoPage 0 0 >> >> So I move windows to page (9,0) as a holding place. What I'd like to do >> is reference the windows on page 9 0 instead of having to goto that >> page. Will reduce flicker of the goto's and make it appear more >> seamless. Is this possible with a regular function? > > Yes, but you can't do it they way you'd like. I would just mark those > windows you're going to put on page 9 0 with a State, then you can do: > > All (State n) MoveToScreen > > Read up on the "State" command/style option. > >> Something like: >> >> + I All (Page 9 0, AnyScreen) MoveToPage 0 0 > > No, this isn't possible. > > -- Thomas Adam > >
I thought this was a neat idea for a function, so I implemented it. SetEnv SWAP_SCREENS_STATE 3 DestroyFunc SwapScreens AddToFunc SwapScreens + I SetEnv old_pointer_x $[pointer.x] + I SetEnv old_pointer_y $[pointer.y] + I All State $[SWAP_SCREENS_STATE] off + I WindowId root $[LEFT_SCREEN] WarpToWindow 50 50 + I All (CurrentPage) State $[SWAP_SCREENS_STATE] on + I All (State $[SWAP_SCREENS_STATE]) MoveToScreen $[RIGHT_SCREEN] + I All (CurrentPage, AnyScreen, !State $[SWAP_SCREENS_STATE]) \ MoveToScreen $[LEFT_SCREEN] + I WindowId root WarpToWindow $[old_pointer_x]p $[old_pointer_y]p + I UnSetEnv old_pointer_x + I UnSetEnv old_pointer_y Key Up A 4C SwapScreens -- Thanks, Jonathan Kotta Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.