@@ -27,6 +27,7 @@ namespace unityapi = unity::shell::application;
27Q_LOGGING_CATEGORY(UNITY_WINDOW, "unity.window", QtWarningMsg)
27Q_LOGGING_CATEGORY(UNITY_WINDOW, "unity.window", QtWarningMsg)
29#define DEBUG_MSG qCDebug(UNITY_WINDOW).nospace() << qPrintable(toString()) << "::" << __func__
29#define DEBUG_MSG qCDebug(UNITY_WINDOW).nospace() << qPrintable(toString()) << "::" << __func__
30+#define WARNING_MSG qCWarning(UNITY_WINDOW).nospace() << qPrintable(toString()) << "::" << __func__
31Window::Window(int id, QObject *parent)
32Window::Window(int id, QObject *parent)
32 : QObject(parent)
33 : QObject(parent)
@@ -184,7 +185,15 @@ void Window::setSurface(unityapi::MirSurfaceInterface *surface)
184 setSurface(nullptr);
185 setSurface(nullptr);
188+ // Surface should never be focused at this point!
189+ if (m_surface->focused()) {
190+ WARNING_MSG << "Inital surface is focused!";
187 // bring it up to speed
193 // bring it up to speed
195+ m_surface->activate();
188 if (m_positionRequested) {
197 if (m_positionRequested) {
189 m_surface->setRequestedPosition(m_requestedPosition);
198 m_surface->setRequestedPosition(m_requestedPosition);