Skip to content

Commit cfb5ee1

Browse files
committed
src/stack: Prevent duplicate signals on close button spam.
It caused GNOME crash due to bug in mutter, which was fixed in v49. But regardless, we should not spam the close signal. Also people might be using versions before 49. Closes: #1794 Signed-off-by: Siddh Raman Pant <25429745+siddhpant@users.noreply.github.com>
1 parent ed3e1a0 commit cfb5ee1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/stack.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,14 @@ const TabButton = GObject.registerClass(
9191
}),
9292
);
9393

94-
close_button.connect('clicked', () => {
95-
window.meta.delete(global.get_current_time());
94+
this._running_close = false;
95+
96+
close_button.connect('clicked', () => {
97+
if (!this._running_close) {
98+
this._running_close = true;
99+
window.meta.delete(global.get_current_time());
100+
this._running_close = false;
101+
}
96102
});
97103

98104
close_button.set_x_align(Clutter.ActorAlign.END);

0 commit comments

Comments
 (0)