[gnome-shell/wip/rstrode/rhel-7.9: 34/86] system: don't throw an exception if power off disabled
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/rhel-7.9: 34/86] system: don't throw an exception if power off disabled
- Date: Fri, 12 Feb 2021 19:04:06 +0000 (UTC)
commit c2033d66ed5ab1352804b79635a19e8007e18f51
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jun 4 13:48:02 2018 -0400
system: don't throw an exception if power off disabled
js/ui/status/system.js | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/status/system.js b/js/ui/status/system.js
index 68a0b4b5b9..2ab38419f6 100644
--- a/js/ui/status/system.js
+++ b/js/ui/status/system.js
@@ -67,12 +67,15 @@ var AltSwitcher = new Lang.Class({
childShown.fake_release();
childShown.remove_action(this._clickAction);
}
- childToShow.add_action(this._clickAction);
- let hasFocus = this.actor.contains(global.stage.get_key_focus());
- this.actor.set_child(childToShow);
- if (hasFocus)
- childToShow.grab_key_focus();
+ if (childToShow) {
+ childToShow.add_action(this._clickAction);
+
+ let hasFocus = this.actor.contains(global.stage.get_key_focus());
+ this.actor.set_child(childToShow);
+ if (hasFocus)
+ childToShow.grab_key_focus();
+ }
// The actors might respond to hover, so
// sync the pointer to make sure they update.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]