From d8231413601e930a4435734160fc0f44869f3a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 19 Apr 2021 18:37:58 +0200 Subject: [PATCH] dialog: Ensure action callback is called with no arguments Using the callback directly as signal handler means that it will receive the signal parameters (in this case: the StButton instance that emits the signal). This leaks an implementation detail that is harmless in the best case, but can break dialogs when using bind() on the callback. Avoid that trap by explicitly calling the callback without arguments. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4139 Part-of: --- js/ui/dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/dialog.js b/js/ui/dialog.js index 3e8bfee7d..9513a8151 100644 --- a/js/ui/dialog.js +++ b/js/ui/dialog.js @@ -133,7 +133,7 @@ class Dialog extends St.Widget { y_expand: true, label, }); - button.connect('clicked', action); + button.connect('clicked', () => action()); buttonInfo['button'] = button;