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.

This commit is contained in:
2026-01-31 11:36:47 -07:00
parent 3710da43c9
commit 946a39c361

View File

@@ -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);