mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1819>
This commit is contained in:
parent
7eba5322b5
commit
d823141360
1 changed files with 1 additions and 1 deletions
|
|
@ -133,7 +133,7 @@ class Dialog extends St.Widget {
|
|||
y_expand: true,
|
||||
label,
|
||||
});
|
||||
button.connect('clicked', action);
|
||||
button.connect('clicked', () => action());
|
||||
|
||||
buttonInfo['button'] = button;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue