on xenial help sign in
[WindowManager] Focus surface on startup only if focus is requested
4169ccdMarius Gripsgard
plugins/WindowManager/Window.cpp+9
@@ -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)
28
28
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__
30
31
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);
185 });
186 });
186
187
188+ // Surface should never be focused at this point!
189+ if (m_surface->focused()) {
190+ WARNING_MSG << "Inital surface is focused!";
191+ }
192+
187 // bring it up to speed
193 // bring it up to speed
194+ if (m_focused) {
195+ m_surface->activate();
196+ }
188 if (m_positionRequested) {
197 if (m_positionRequested) {
189 m_surface->setRequestedPosition(m_requestedPosition);
198 m_surface->setRequestedPosition(m_requestedPosition);
190 }
199 }