Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions src/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ export class Launcher extends search.Search {
}

launch_desktop_entry(entry: JsonIPC.DesktopEntry) {
if (!("AppLaunchGpu" in Shell)) {
this.launch_gio(entry);
return;
}

const basename = (name: string): string => {
return name.substr(name.indexOf('/applications/') + 14).replace('/', '-')
}
Expand All @@ -212,14 +217,7 @@ export class Launcher extends search.Search {
log.error(`GNOME Shell cannot find desktop entry for ${desktop_entry_id}`)
log.error(`pop-launcher will use Gio.DesktopAppInfo instead`);

const dapp = Gio.DesktopAppInfo.new_from_filename(entry.path);

if (!dapp) {
log.error(`could not find desktop entry for ${entry.path}`);
return;
}

this.launch_desktop_app(dapp, entry.path);
this.launch_gio(entry)
return;
}

Expand Down Expand Up @@ -293,6 +291,17 @@ export class Launcher extends search.Search {
})
}

launch_gio(entry: JsonIPC.DesktopEntry) {
const dapp = Gio.DesktopAppInfo.new_from_filename(entry.path);

if (!dapp) {
log.error(`could not find desktop entry for ${entry.path}`);
return;
}

this.launch_desktop_app(dapp, entry.path);
}

list_workspace(ext: Ext) {
for (const window of ext.tab_list(Meta.TabList.NORMAL, null)) {
this.windows.insert(window);
Expand Down