Launcher: AppPlugin, close panel immediately to avoid focusing issues.

This commit is contained in:
LemmyCook 2025-09-16 12:09:12 -04:00
parent 8e034cd912
commit 2c3eb6efda

View file

@ -79,8 +79,11 @@ Item {
"icon": app.icon || "application-x-executable", "icon": app.icon || "application-x-executable",
"isImage": false, "isImage": false,
"onActivate": function () { "onActivate": function () {
Logger.log("ApplicationsPlugin", `Launching: ${app.name}`) // Close the launcher/NPanel immediately without any animations.
// Ensures we are not preventing the future focusing of the app
launcher.closeCompleted()
Logger.log("ApplicationsPlugin", `Launching: ${app.name}`)
if (Settings.data.appLauncher.useApp2Unit && app.id) { if (Settings.data.appLauncher.useApp2Unit && app.id) {
Logger.log("ApplicationsPlugin", `Using app2unit for: ${app.id}`) Logger.log("ApplicationsPlugin", `Using app2unit for: ${app.id}`)
if (app.runInTerminal) if (app.runInTerminal)
@ -89,11 +92,9 @@ Item {
Quickshell.execDetached(["app2unit", "--"].concat(app.command)) Quickshell.execDetached(["app2unit", "--"].concat(app.command))
} else if (app.execute) { } else if (app.execute) {
app.execute() app.execute()
} else if (app.exec) { } else {
// Fallback to manual execution Logger.log("ApplicationsPlugin", `Could not launch: ${app.name}`)
Process.execute(app.exec)
} }
launcher.close()
} }
} }
} }