Bug Description

window management - Restoring a semi-maximised window by dragging the title bar downwards restores the window into the wrong shape and position

To Reproduce:
1. Semi-maximise a window
2. Try to restore the window by dragging the title bar of the semi-maximised window downwards

What currently incorrectly happens:
- The window shifts to the restored state but remains the same size and shape as when it was semi-maximised. The window also gets disconnected from the pointer and shifts downwards. See attached screencast "semimaximise_restore_issue.ogv" for a demonstration.

What should happen:
- When a window is restored it should return to the exact same size and shape as it was before it was semi-maximised or maximised.
- If a window is restored by dragging the title bar downwards with the pointer, after the window snaps out of the maximsed state, the window title bar should remain locked to the pointer until the drag is released.
- If a window is restored by clicking the 'restore' window decoration or by using a keyboard shortcut, the window should be restored to the exact position it was before it was maximised or semi-maximised