diff --git a/src/apprt/gtk/class/window.zig b/src/apprt/gtk/class/window.zig index c0dd6ab1f..31a4cc6ff 100644 --- a/src/apprt/gtk/class/window.zig +++ b/src/apprt/gtk/class/window.zig @@ -693,6 +693,10 @@ pub const Window = extern struct { self: *Self, tree: *const Surface.Tree, ) void { + // Ensure that all old signal handlers have been removed before adding + // them. Otherwise we get duplicate surface handlers. + self.disconnectSurfaceHandlers(tree); + const priv = self.private(); var it = tree.iterator(); while (it.next()) |entry| {