Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(launcher): Exception in GNOME 3.36 due to Shell.AppLaunchGPU being undefined #1205

Open
wants to merge 1 commit into
base: master_focal
Choose a base branch
from
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