@@ -108,9 +108,6 @@ void ApplicationInfo::createSurface()
108108 m_closingSurfaces.removeAll(surface);
109109 }
110110 });
111− connect(surface, &MirSurface::focusRequested, this, [this](){
112− Q_EMIT this->focusRequested();
113− });
114111 connect(surface, &MirSurface::closeRequested, this, [this, surface](){
115112 m_closingSurfaces.append(surface);
116113 if (m_state == Suspended) {
@@ -367,3 +364,12 @@ void ApplicationInfo::onSurfaceCountChanged()
367364 setState(Stopped);
368365 }
369366}
367+
368+void ApplicationInfo::requestFocus()
369+{
370+ if (m_surfaceList.count() == 0) {
371+ Q_EMIT focusRequested();
372+ } else {
373+ m_surfaceList.get(0)->requestFocus();
374+ }
375+}