From 946a39c361f744c8d9ecd3a68603e993db524315 Mon Sep 17 00:00:00 2001 From: deepend Date: Sat, 31 Jan 2026 11:36:47 -0700 Subject: [PATCH] Updated the disabled drag-motion block to traverse parents with gtk_widget_get_parent() and use GTK3-safe paned child accessors while retaining legacy fields for non-GTK3 builds. --- src/fe-gtk/maingui.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 3fc0b32d..e456ac4e 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -4616,8 +4616,18 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui #if 0 /* are both tree/userlist on the same side? */ GtkPaned *paned; - paned = (GtkPaned *)widget->parent->parent; - if (paned->child1 != NULL && paned->child2 != NULL) + GtkWidget *parent; + GtkWidget *grandparent; + parent = gtk_widget_get_parent (widget); + grandparent = parent ? gtk_widget_get_parent (parent) : NULL; + paned = grandparent ? GTK_PANED (grandparent) : NULL; +#if HAVE_GTK3 + if (paned != NULL && + gtk_paned_get_child1 (paned) != NULL && + gtk_paned_get_child2 (paned) != NULL) +#else + if (paned != NULL && paned->child1 != NULL && paned->child2 != NULL) +#endif { cairo_rectangle (cr, 1 + ox, 2 + oy, width - 3, height - 4); cairo_rectangle (cr, 0 + ox, 1 + oy, width - 1, height - 2);