[gnome-shell] panel: Relax check for existing signal handler
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] panel: Relax check for existing signal handler
- Date: Fri, 12 Jul 2019 19:00:23 +0000 (UTC)
commit 16ca7a21a7c39406aa27dfa46357e9e5c4197e74
Author: Florian Müllner <fmuellner gnome org>
Date: Sun Jun 30 01:04:32 2019 +0200
panel: Relax check for existing signal handler
Object.prototype.hasOwnProperty() is more precise than checking for
falsiness, for instance the following is true:
{ foo: undefined }.hasOwnProperty('foo');
However when checking for a handler ID, a more relaxed check is more
appropriate, as particularly 0 is not a valid handler ID.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
js/ui/panel.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index fcb51950f..6b8e60b19 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -1167,7 +1167,7 @@ class Panel extends St.Widget {
}
_onMenuSet(indicator) {
- if (!indicator.menu || indicator.menu.hasOwnProperty('_openChangedId'))
+ if (!indicator.menu || indicator.menu._openChangedId)
return;
indicator.menu._openChangedId = indicator.menu.connect('open-state-changed',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]