From adba77c3f9d5375942f09ce2b7b7d68734cb2f4a Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Fri, 27 Oct 2023 06:34:57 +0200 Subject: [PATCH] gtk: fix warning when replacing children of Paned --- src/apprt/gtk/Paned.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apprt/gtk/Paned.zig b/src/apprt/gtk/Paned.zig index 731513e0d..455158fdc 100644 --- a/src/apprt/gtk/Paned.zig +++ b/src/apprt/gtk/Paned.zig @@ -152,6 +152,10 @@ pub fn replaceChildInPosition(self: *Paned, child: Child, position: Position) vo // Keep position of divider const parent_paned_position_before = c.gtk_paned_get_position(self.paned); + // Focus on the sibling, otherwise we'll get a GTK warning + self.focusSurfaceInPosition(if (position == .start) .end else .start); + + // Now we can remove the other one self.removeChildInPosition(position); switch (position) {