move to screen button and maximazation

ok so I have two monitors (both 1280x1024) and EwmhBaseStruts is set to stop 48 pixels from the bottom on both screens
but on the secondary monitor its set to stop 180 pixels from the right (for fvwmbuttons) my fvwm decor has four buttons on the right (from right to left) ‘close’, ‘maximize’, ‘iconify’, and the ‘movetoscreen’ buttons

DestroyFunc Fvwmmovetoscreen
AddToFunc   Fvwmmovetoscreen
+ M nop
+ C Fvwmtoscreen $0
+ D nop

DestroyFunc Fvwmtoscreen
AddToFunc   Fvwmtoscreen
+ I Maximize 
+ I movetoscreen $0
+ I Maximize

DestroyFunc FvwmIconifyOrShade
AddToFunc   FvwmIconifyOrShade
+ C Iconify
+ D WindowShade

DestroyFunc FvwmMaximize
AddToFunc   FvwmMaximize
+ H Nop
+ M Nop
+ C Maximize $0 $1

DestroyFunc FvwmMoveOrIconify
AddToFunc   FvwmMoveOrIconify
+ M Move
+ D Iconify
+ Mouse 1 2 A FvwmDeleteOrDestroy
+ Mouse 1 6 A FvwmIconifyOrShade
+ Mouse 1 4 A FvwmMaximize 100 100
+ Mouse 2 4 A FvwmMaximize 0 100
+ Mouse 3 4 A FvwmMaximize 100 0
+ Mouse 4 T A FvwmWindowShade True
+ Mouse 5 T A FvwmWindowShade False
+ Mouse 1 8 A Fvwmmovetoscreen 0
+ Mouse 3 8 A Fvwmmovetoscreen 1
+ Mouse 3 T A Menu FvwmWindowOpsMenu

the first problem is that the ‘movetoscreen’ button only works if the window is maximized(if I take the maximization commands out then I have to re-maximize the window after its moved), the second is that I would rather have the window move to the next screen on mouse 1, like the Nvidia button, and when I de-maximize the window it goes back to the screen it was on

Nonsense.

Here’s how you ought to have written it:

DestroyFunc Fvwmtoscreen
AddToFunc   Fvwmtoscreen
+ I movetoscreen $0

That way you don’t care about maximisation at all. If though you wanted it to be maximized only after moving the window then:

DestroyFunc Fvwmtoscreen
AddToFunc   Fvwmtoscreen
+ I movetoscreen $0
+ I ThisWindow (!Maximized) Maximize

Or, if you wanted it such that it would maximize the window if it wasn’t already before moving the window then shift the test to the top:

DestroyFunc Fvwmtoscreen
AddToFunc   Fvwmtoscreen
+ I ThisWindow (!Maximized) Maximize
+ I movetoscreen $0

See the last example of mine, above.

– Thomas Adam

not what I had in mind but it helped

DestroyFunc Fvwmtoscreen
AddToFunc   Fvwmtoscreen
+ I  movetoscreen $0
+ I ThisWindow (Maximized) Maximize true 100 100

this works perfectly

So it was what you had in mind then… you’re using it.

Oh, and you’re very welcome.

– Thomas Adam