Added proper handling of resize, move and maximize events

Added proper handling of Resize, Move and Maximise events to ensure that
the GUI behaves as expected.