diff --git a/js/misc/util.js b/js/misc/util.js index 670fbff769..9dff70a646 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -369,12 +369,12 @@ const _IGNORED_PHRASES = [ ]; function fixupPCIDescription(desc) { - desc = desc.replace(/[_,]/, ' '); + desc = desc.replace(/[_,]/g, ' '); /* Remove any parenthesized info longer than 2 chars (which may be disambiguating numbers if there are multiple identical cards present) */ - desc = desc.replace(/\([\s\S][^\(\)]{2,}\)/, ''); + desc = desc.replace(/\([\s\S][^\(\)]{2,}\)/g, ''); /* Attempt to shorten ID by ignoring certain phrases */ for (let i = 0; i < _IGNORED_PHRASES.length; i++) { diff --git a/js/ui/cinnamonDBus.js b/js/ui/cinnamonDBus.js index 086e3ef837..21e9bf394f 100644 --- a/js/ui/cinnamonDBus.js +++ b/js/ui/cinnamonDBus.js @@ -374,6 +374,10 @@ var CinnamonDBus = class { activateCallback(callback, uuid, instance_id) { let obj = this._getXletObject(uuid, instance_id); + if (!obj) { + global.logWarning(`[CinnamonDBus] activateCallback: xlet not found (uuid=${uuid}, instance_id=${instance_id})`); + return; + } let cb = obj[callback].bind(obj); cb(); } @@ -386,6 +390,13 @@ var CinnamonDBus = class { ); return; } + if (!Main.settingsManager.uuids[uuid][instance_id]) { + global.logWarning( + `[CinnamonDBus] [${uuid}] Unable to find instance '${instance_id}' from SettingsManager - ` + + 'this is likely due to configuring settings from a removed xlet instance.' + ); + return; + } Main.settingsManager.uuids[uuid][instance_id].remoteUpdate(key, payload); } @@ -549,7 +560,6 @@ var CinnamonDBus = class { for (let idx in sources) { const source = sources[idx]; - // global.log(source.preferences); ret.push([ source.type, source.id, diff --git a/js/ui/keyboardManager.js b/js/ui/keyboardManager.js index bf23d4b58e..ff9f94f2bc 100644 --- a/js/ui/keyboardManager.js +++ b/js/ui/keyboardManager.js @@ -12,11 +12,11 @@ const PopupMenu = imports.ui.popupMenu; const Cairo = imports.cairo; const Util = imports.misc.util; -DESKTOP_INPUT_SOURCES_SCHEMA = 'org.cinnamon.desktop.input-sources'; -KEY_INPUT_SOURCES = 'sources'; -KEY_KEYBOARD_OPTIONS = 'xkb-options'; -KEY_PER_WINDOW = 'per-window'; -KEY_SOURCE_LAYOUTS = 'source-layouts'; +var DESKTOP_INPUT_SOURCES_SCHEMA = 'org.cinnamon.desktop.input-sources'; +var KEY_INPUT_SOURCES = 'sources'; +var KEY_KEYBOARD_OPTIONS = 'xkb-options'; +var KEY_PER_WINDOW = 'per-window'; +var KEY_SOURCE_LAYOUTS = 'source-layouts'; var INPUT_SOURCE_TYPE_XKB = 'xkb'; var INPUT_SOURCE_TYPE_IBUS = 'ibus'; diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 7c01633a5c..2ba1b3d29b 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -173,6 +173,9 @@ NotificationDaemon.prototype = { case Urgency.CRITICAL: stockIcon = 'xsi-dialog-error-symbolic'; break; + default: + stockIcon = 'xsi-dialog-information-symbolic'; + break; } return new St.Icon({ icon_name: stockIcon, icon_type: St.IconType.SYMBOLIC, @@ -265,7 +268,13 @@ NotificationDaemon.prototype = { let ndata = this._expireNotifications[0]; if (ndata) { - ndata.notification.destroy(MessageTray.NotificationDestroyedReason.EXPIRED); + if (ndata.notification) { + ndata.notification.destroy(MessageTray.NotificationDestroyedReason.EXPIRED); + } else { + // notification object not yet created (async PID lookup still pending) + this._expireNotifications.shift(); + this._restartExpire(); + } } this._expireTimer = 0; diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 5075b19965..6f5fd57db6 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -100,9 +100,9 @@ class DisplayChangeDialog extends ModalDialog.ModalDialog { } _formatCountDown() { - let fmt = ngettext("Reverting to previous display settings in %d second.", - "Reverting to previous display settings in %d seconds."); - return fmt.format(this._countDown); + return ngettext("Reverting to previous display settings in %d second.", + "Reverting to previous display settings in %d seconds.", + this._countDown).format(this._countDown); } _tick() {