MoveToPage -- correcting the center of the window?

FVWM seems to calculate which “page” a window is on by the upper left corner of that window, not by the center – which means that with my setup (with heavy use of movetopage to teleport windows onto the “right” page) sometimes a window ends up on the wrong page due to a small fraction of the window being on a different page.

Is there a way to change this behavior so that MoveToPage instead bases both the starting and destination pages on the center of the window, not the upper left?

Create a custom MoveToPage function like[code]RemoveFunc CustMoveToPage
AddToFunc CustMoveToPage

  • I MoveToPage $0 $1
  • I Move w50 w50[/code]Explanation:
    Moves the selected window to another page ($0, $1)
    Moves the window 50% of it’s width to the right and 50% of it’s height down (trailing ‘w’ means precent of the window width/height).

I haven’t tested it but that’s the way you get the result you want.

– Thomas –

Hmm. Your code is off, but I guess the method might work?

THe issue is that since the window is “in” the inobvious (above, to the left) window, it ends up in the “wrong” final window.

But what if my custom function moved the window down and to the left 50%, then executed a normal move2page, then moved it up and to the right 50% – that shoudl fix it without side effects, yes?

DestroyFunc MoveCenterToPage
AddToFunc MoveCenterToPage

  • I Move w50 w50
  • I MoveToPage $0 $1
  • I Move w-50 w-50

Except…that’s flickery, and doesn’t seem to solve the problem. So I don’t know what’s up with that.

:frowning: This is the prob with untested code :blush: . Sorry for that …

I have checked it and the problem is, that ‘move’ works only in the active page. So the window is ‘jumped back’ :confused:

With this in mind the function should looks like [code]DestroyFunc MoveCenterToPage
AddToFunc MoveCenterToPage

  • I Move 50-50w 50-50w
  • I MoveToPage $0 $1[/code]

As I understand you right, you move the window out of your focus to another page and then, in some cases, it doesn’t position correctly and switch in a neighbour page?

That could be a problem of your SnapGrid and SnapAttraction Style options. From the ‘Style’ docu:

Try Style * SnapAttraction 3 All

– Thomas –