quickshell: fix pinned tiles never launching
launchPin passed a bare DesktopEntry to activate(), but activate() started dispatching on a `kind` field when the results list became heterogeneous (apps + files + web). A bare entry has no `kind`, so every pin click fell through to the no-op branch: the tiles rendered, hovered and dragged correctly and simply never launched. Regression from "launcher searches files and the web". Wrap via appItem() so the pin takes the same path as a search result, and make activate()'s fallthrough console.warn instead of returning quietly — the silence is the only reason this survived a release. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
a927cf6ba9
commit
4b4ae52c65
1 changed files with 13 additions and 2 deletions
|
|
@ -1575,7 +1575,14 @@ in
|
||||||
if (item.kind === "app") item.app.execute();
|
if (item.kind === "app") item.app.execute();
|
||||||
else if (item.kind === "file") Quickshell.execDetached([Commands.xdgOpen, item.path]);
|
else if (item.kind === "file") Quickshell.execDetached([Commands.xdgOpen, item.path]);
|
||||||
else if (item.kind === "web") Quickshell.execDetached([Commands.xdgOpen, item.url]);
|
else if (item.kind === "web") Quickshell.execDetached([Commands.xdgOpen, item.url]);
|
||||||
else return;
|
else {
|
||||||
|
// Shout rather than no-op. An unwrapped DesktopEntry
|
||||||
|
// reaching here is a caller bug, and the silent
|
||||||
|
// version of it cost an afternoon: the pin tiles
|
||||||
|
// looked fine and simply never launched anything.
|
||||||
|
console.warn("launcher: activate() got no usable kind:", JSON.stringify(item));
|
||||||
|
return;
|
||||||
|
}
|
||||||
open = false;
|
open = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2083,8 +2090,12 @@ in
|
||||||
pinFile.writeAdapter();
|
pinFile.writeAdapter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Must go through appItem(): activate() dispatches on `kind`,
|
||||||
|
// so handing it a bare DesktopEntry silently does nothing.
|
||||||
function launchPin(id) {
|
function launchPin(id) {
|
||||||
activate(DesktopEntries.applications.values.find(a => a.id === id));
|
const app = DesktopEntries.applications.values.find(a => a.id === id);
|
||||||
|
if (app === undefined) return;
|
||||||
|
activate(appItem(app));
|
||||||
}
|
}
|
||||||
|
|
||||||
// App matches for the current query, kept apart from
|
// App matches for the current query, kept apart from
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue