I have done some refactoring, cleanup and some bug fixing.
- An UbuntuWindow internally creates UbuntuSurface - UbuntuSurface is responsible for creating the mir surfaces and calling mir apis - Fix mutex locking (now really protecting access to mSurface) was not locked properly (QMutexLocker temporaries were created : QMutexLocker(&d->mutex) instead of QMutexLocker lock(&d->mutex). - Handling resize events from the server has been improved. -- Old resize events are dropped - meaning no redraw requests are issued if we know there are newer resize events in the queue -- Redraw requests are never issued through the rendering thread only through the Qt event dispatch thread. -- No flushing of event queue which leads to fewer interruptions in other surfaces (specially noticeable on surfaces that do animations). - Workaround QtCreator not assigning a parent to its menu bar menus -- The last focused window is tracked and used if a Qt popup is created without a parent - Client requested resizes (through setGeometry) is now supported - Resizing constraints are supported (propagateSizeHints) - Visibility and window state are tracked separately - Better focusing event handling -- When an app has multiple windows, mir will send focus lost/gain pairs, in which case we need to peek into the queue to avoid telling Qt to unfocus all windows prematurely. Approved by: PS Jenkins bot, Daniel d'Andrada