forked from rpms/gnome-shell
Fix JS Error in log about background apps
This commit is contained in:
parent
d4ed69f2f4
commit
fccc02f84c
@ -0,0 +1,88 @@
|
|||||||
|
From e442e9daf632d2ceb276f9e254d5850a33f91667 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ray Strode <rstrode@redhat.com>
|
||||||
|
Date: Wed, 6 Sep 2023 09:23:51 -0400
|
||||||
|
Subject: [PATCH] backgroundApps: Don't crash if app id can't be looked up
|
||||||
|
|
||||||
|
I'm looking at a log file with this trace back:
|
||||||
|
|
||||||
|
JS ERROR: TypeError: a.app is null
|
||||||
|
_sync/<@resource:///org/gnome/shell/ui/status/backgroundApps.js:226:17
|
||||||
|
_sync@resource:///org/gnome/shell/ui/status/backgroundApps.js:225:14
|
||||||
|
_init/</<@resource:///org/gnome/shell/ui/status/backgroundApps.js:170:67
|
||||||
|
@resource:///org/gnome/shell/ui/init.js:21:20
|
||||||
|
|
||||||
|
This commit should avoid the failure by filtering out items where
|
||||||
|
lookup_app fails.
|
||||||
|
---
|
||||||
|
js/ui/status/backgroundApps.js | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/js/ui/status/backgroundApps.js b/js/ui/status/backgroundApps.js
|
||||||
|
index d6f2e495b..5dff0bdff 100644
|
||||||
|
--- a/js/ui/status/backgroundApps.js
|
||||||
|
+++ b/js/ui/status/backgroundApps.js
|
||||||
|
@@ -199,60 +199,61 @@ class BackgroundAppsToggle extends QuickToggle {
|
||||||
|
}
|
||||||
|
|
||||||
|
_syncVisibility() {
|
||||||
|
const {isLocked} = Main.sessionMode;
|
||||||
|
const nBackgroundApps = this._proxy?.BackgroundApps?.length;
|
||||||
|
// We cannot hide the quick toggle while the menu is open, otherwise
|
||||||
|
// the menu position goes bogus. We can't show it in locked sessions
|
||||||
|
// either
|
||||||
|
this.visible = !isLocked && (this.menu.isOpen || nBackgroundApps > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
_sync() {
|
||||||
|
this._syncVisibility();
|
||||||
|
|
||||||
|
if (!this._proxy)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const {BackgroundApps: backgroundApps} = this._proxy;
|
||||||
|
|
||||||
|
this._appsSection.removeAll();
|
||||||
|
|
||||||
|
const items = new Map();
|
||||||
|
(backgroundApps ?? [])
|
||||||
|
.map(backgroundApp => {
|
||||||
|
const appId = backgroundApp.app_id.deepUnpack();
|
||||||
|
const app = this._appSystem.lookup_app(`${appId}.desktop`);
|
||||||
|
const message = backgroundApp.message?.deepUnpack();
|
||||||
|
|
||||||
|
return {app, message};
|
||||||
|
})
|
||||||
|
+ .filter(backgroundApp => backgroundApp.app)
|
||||||
|
.sort((a, b) => {
|
||||||
|
return a.app.get_name().localeCompare(b.app.get_name());
|
||||||
|
})
|
||||||
|
.forEach(backgroundApp => {
|
||||||
|
const {app, message} = backgroundApp;
|
||||||
|
|
||||||
|
let item = items.get(app);
|
||||||
|
if (!item) {
|
||||||
|
item = new BackgroundAppMenuItem(app);
|
||||||
|
items.set(app, item);
|
||||||
|
this._appsSection.addMenuItem(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (message)
|
||||||
|
item.set({message});
|
||||||
|
});
|
||||||
|
|
||||||
|
const nBackgroundApps = items.size;
|
||||||
|
this.title = nBackgroundApps === 0
|
||||||
|
? _('No Background Apps')
|
||||||
|
: ngettext(
|
||||||
|
'%d Background App',
|
||||||
|
'%d Background Apps',
|
||||||
|
nBackgroundApps).format(nBackgroundApps);
|
||||||
|
this._listTitle.visible = nBackgroundApps > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
vfunc_clicked() {
|
||||||
|
this.menu.open();
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: gnome-shell
|
Name: gnome-shell
|
||||||
Version: 45~beta.1
|
Version: 45~beta.1
|
||||||
Release: %autorelease -b 2
|
Release: %autorelease
|
||||||
Summary: Window management and application launching for GNOME
|
Summary: Window management and application launching for GNOME
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -10,16 +10,18 @@ URL: https://wiki.gnome.org/Projects/GnomeShell
|
|||||||
Source0: https://download.gnome.org/sources/gnome-shell/45/%{name}-%{tarball_version}.tar.xz
|
Source0: https://download.gnome.org/sources/gnome-shell/45/%{name}-%{tarball_version}.tar.xz
|
||||||
|
|
||||||
# Replace Epiphany with Firefox in the default favourite apps list
|
# Replace Epiphany with Firefox in the default favourite apps list
|
||||||
Patch10001: gnome-shell-favourite-apps-firefox.patch
|
Patch: gnome-shell-favourite-apps-firefox.patch
|
||||||
|
|
||||||
# Some users might have a broken PAM config, so we really need this
|
# Some users might have a broken PAM config, so we really need this
|
||||||
# downstream patch to stop trying on configuration errors.
|
# downstream patch to stop trying on configuration errors.
|
||||||
Patch40001: 0001-gdm-Work-around-failing-fingerprint-auth.patch
|
Patch: 0001-gdm-Work-around-failing-fingerprint-auth.patch
|
||||||
|
|
||||||
Patch: 0001-status-keyboard-Add-a-catch-around-reload-call.patch
|
Patch: 0001-status-keyboard-Add-a-catch-around-reload-call.patch
|
||||||
Patch: 0002-status-keyboard-Load-keyboard-from-system-settings-i.patch
|
Patch: 0002-status-keyboard-Load-keyboard-from-system-settings-i.patch
|
||||||
Patch: 0003-status-keyboard-Use-gnome-desktop-API-for-getting-de.patch
|
Patch: 0003-status-keyboard-Use-gnome-desktop-API-for-getting-de.patch
|
||||||
|
|
||||||
|
Patch: 0001-backgroundApps-Don-t-crash-if-app-id-can-t-be-looked.patch
|
||||||
|
|
||||||
%define eds_version 3.45.1
|
%define eds_version 3.45.1
|
||||||
%define gnome_desktop_version 44.0-7
|
%define gnome_desktop_version 44.0-7
|
||||||
%define glib2_version 2.56.0
|
%define glib2_version 2.56.0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user