From: Georges Basile Stavracas Neto Date: Tue, 9 Aug 2022 17:20:25 +0000 (-0300) Subject: paned: Warn if child is not actually a child X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~4^2~6^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=29580d425203afb93b54a7757f877eef04d4aebd;p=gtk4.git paned: Warn if child is not actually a child This will at least allow us to debug this in the future. --- diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index a3cb71081a..4dde590724 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -1977,6 +1977,15 @@ gtk_paned_set_focus_child (GtkWidget *widget, if (GTK_IS_PANED (w)) last_focus = w; + if (w == NULL) + { + g_warning ("Error finding last focus widget of GtkPaned %p, " + "gtk_paned_set_focus_child was called on widget %p " + "which is not child of %p.", + widget, child, widget); + return; + } + focus_child = gtk_widget_get_focus_child (widget); if (focus_child == paned->start_child) gtk_paned_set_last_start_child_focus (paned, last_focus);