on xenial help sign in
fix review comments; try a snap pkg first
d6b38ceLukáš Tinkl
qml/Stage/Stage.qml+11−8
@@ -227,14 +227,9 @@ FocusScope {
227 GlobalShortcut {
227 GlobalShortcut {
228 shortcut: Qt.ControlModifier|Qt.AltModifier|Qt.Key_T
228 shortcut: Qt.ControlModifier|Qt.AltModifier|Qt.Key_T
229 onTriggered: {
229 onTriggered: {
230− const termAppName = "ubuntu-terminal-app";
230+ // Try snap first, then deb package
231− var termInfo = root.applicationManager.findApplication(termAppName);
231+ if (!priv.startApp("ubuntu-terminal-app_ubuntu-terminal-app")) {
232− if (termInfo) {
232+ priv.startApp("ubuntu-terminal-app");
233− if (!termInfo.focused) {
234− root.applicationManager.requestFocusApplication(termAppName);
235− }
236− } else {
237− root.applicationManager.startApplication(termAppName);
238 }
233 }
239 }
234 }
240 }
235 }
@@ -243,6 +238,14 @@ FocusScope {
243 id: priv
238 id: priv
244 objectName: "DesktopStagePrivate"
239 objectName: "DesktopStagePrivate"
245
240
241+ function startApp(appId) {
242+ if (root.applicationManager.findApplication(appId)) {
243+ return root.applicationManager.requestFocusApplication(appId);
244+ } else {
245+ return root.applicationManager.startApplication(appId) !== null;
246+ }
247+ }
248+
246 property var focusedAppDelegate: null
249 property var focusedAppDelegate: null
247 property var foregroundMaximizedAppDelegate: null // for stuff like drop shadow and focusing maximized app by clicking panel
250 property var foregroundMaximizedAppDelegate: null // for stuff like drop shadow and focusing maximized app by clicking panel
248
251