Fix limit window movements

Window move limiter not working well in some cases because limits were
calculated relative to the document and not to wm-space.
v0.1.18