Restoring the window placement after fullscreen

In Fvwm-Crystal svn, I use the following fullscreen functions (It is other functions to cycle trough the fullscreened windows.):

[code]InfoStoreAdd TmpDirectory “/tmp”

Wrapper function {{{1

State 19 = FS (fullscreen), State 20 = visible

DestroyFunc Fullscreen
AddToFunc Fullscreen

  • I ThisWindow (State 19) Fullscreen-Stop
  • I TestRc (NoMatch) ThisWindow (!State 19) Fullscreen-Start

fullscreen

DestroyFunc Fullscreen-Start
AddToFunc Fullscreen-Start

  • I SetEnv “FSWindowWidth_$[w.id]” “$[w.width]p”
  • I SetEnv “FSWindowHeight_$[w.id]” “$[w.height]p”
  • I SetEnv “FSWindowX_$[w.id]” “$[w.x]p”
  • I SetEnv “FSWindowY_$[w.id]” “$[w.y]p”
  • I WindowStyle !Title, !Borders, Iconifiable, ResizeHintOverride
  • I UpdateStyles
  • I WindowStyle State 19
  • I WindowStyle State 20
  • I Maximize ewmhiwa True 100 100
  • I WindowStyle !Maximizable, FixedSize
  • I UpdateStyles

We need 1 temporary file for restoring the window state after restart

  • I Exec exec touch $[infostore.TmpDirectory]/fullscreen.19.$[w.id].$[page.nx].$[page.ny].tmp

quit fullscreen

DestroyFunc Fullscreen-Stop
AddToFunc Fullscreen-Stop

  • I WindowStyle Title, Borders, Iconifiable, !ResizeHintOverride
  • I WindowStyle Maximizable, !FixedSize
  • I WindowStyle !State 19
  • I WindowStyle !State 20
  • I Test (f $[infostore.TmpDirectory]/fullscreen.19.$[w.id].$[page.nx].$[page.ny].tmp) Exec exec rm -f $[infostore.TmpDirectory]/fullscreen.19.$[w.id].$[page.nx].$[page.ny].tmp
  • I UpdateStyles
  • I Maximize True $[FSWindowWidth_$[w.id]] $[FSWindowHeight_$[w.id]]
  • I PlaceAgain
  • I UnsetEnv “FSWindowWidth_$[w.id]”
  • I UnsetEnv “FSWindowHeight_$[w.id]”
  • I UnsetEnv “FSWindowX_$[w.id]” “$[w.x]p”
  • I UnsetEnv “FSWindowY_$[w.id]” “$[w.y]p”

Key KP_Multiply A M Fullscreen[/code]

This work fine, but only the size of the windows is restored. And I want to restore their initial placement too.

If I replace

[code]+ I Maximize True $[FSWindowWidth_$[w.id]] $[FSWindowHeight_$[w.id]]

  • I PlaceAgain[/code]
    by
+ I ResizeMove $[FSWindowWidth_$[w.id]] $[FSWindowHeight_$[w.id]] $[FSWindowX_$[w.id]] $[FSWindowY_$[w.id]]

or

[code]+ I Maximize True $[FSWindowWidth_$[w.id]] $[FSWindowHeight_$[w.id]]

  • I Move $[FSWindowX_$[w.id]] $[FSWindowY_$[w.id]][/code]
    (Move with or without ewmhiwa)

The size is correct, but the placement is shifted right and down at each restore from fullscreen. I get the same shift when using $[cw.x]p and $[cw.x]p instead of $[w.x]p or $[w.x]p

Is it something I can do to restore both the size and initial placement of the window?