@@ -27,6 +27,7 @@ namespace unityapi = unity::shell::application;
2727Q_LOGGING_CATEGORY(UNITY_WINDOW, "unity.window", QtWarningMsg)
2828
2929#define DEBUG_MSG qCDebug(UNITY_WINDOW).nospace() << qPrintable(toString()) << "::" << __func__
30+#define WARNING_MSG qCWarning(UNITY_WINDOW).nospace() << qPrintable(toString()) << "::" << __func__
3031
3132Window::Window(int id, QObject *parent)
3233 : QObject(parent)
@@ -184,7 +185,15 @@ void Window::setSurface(unityapi::MirSurfaceInterface *surface)
184185 setSurface(nullptr);
185186 });
186187
188+ // Surface should never be focused at this point!
189+ if (m_surface->focused()) {
190+ WARNING_MSG << "Inital surface is focused!";
191+ }
192+
187193 // bring it up to speed
194+ if (m_focused) {
195+ m_surface->activate();
196+ }
188197 if (m_positionRequested) {
189198 m_surface->setRequestedPosition(m_requestedPosition);
190199 }