on xenial help sign in
Fix ApplicationManager.focusedApplicationId when you click/tap on a unfocused window
e5904daDaniel d'Andrada
qml/Stages/DesktopStage.qml+8−4
@@ -77,7 +77,7 @@ Rectangle {
77 var appIndex = priv.indexOf(appId);
77 var appIndex = priv.indexOf(appId);
78 var appDelegate = appRepeater.itemAt(appIndex);
78 var appDelegate = appRepeater.itemAt(appIndex);
79 appDelegate.minimized = false;
79 appDelegate.minimized = false;
80− ApplicationManager.focusApplication(appId);
80+ appDelegate.focus = true;
81 }
81 }
82 }
82 }
83
83
@@ -179,7 +179,7 @@ Rectangle {
179 function focusSelected() {
179 function focusSelected() {
180 if (appRepeater.highlightedIndex != -1) {
180 if (appRepeater.highlightedIndex != -1) {
181 var application = ApplicationManager.get(appRepeater.highlightedIndex);
181 var application = ApplicationManager.get(appRepeater.highlightedIndex);
182− ApplicationManager.focusApplication(application.appId);
182+ ApplicationManager.requestFocusApplication(application.appId)
183 }
183 }
184 }
184 }
185
185
@@ -204,7 +204,11 @@ Rectangle {
204 property bool maximized: false
204 property bool maximized: false
205 property bool minimized: false
205 property bool minimized: false
206
206
207− focus: priv.focusedAppId === model.appId && root.state !== "altTab"
207+ onFocusChanged: {
208+ if (focus && ApplicationManager.focusedApplicationId !== model.appId) {
209+ ApplicationManager.focusApplication(model.appId);
210+ }
211+ }
208
212
209 Binding {
213 Binding {
210 target: ApplicationManager.get(index)
214 target: ApplicationManager.get(index)
@@ -315,7 +319,7 @@ Rectangle {
315 resizeHandleWidth: units.gu(2)
319 resizeHandleWidth: units.gu(2)
316 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
320 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
317
321
318− onPressed: ApplicationManager.focusApplication(model.appId);
322+ onPressed: { appDelegate.focus = true; }
319 }
323 }
320
324
321 DecoratedWindow {
325 DecoratedWindow {