From 00eb2de4c8c409cc652a91fa8b3f360780f1eeda Mon Sep 17 00:00:00 2001 From: deepend Date: Fri, 23 Jan 2026 21:55:46 -0700 Subject: [PATCH] Split the GTK3 and GTK2 branches in gtk_xtext_unrealize() so GTK3 uses gtk_widget_get_window() while the GTK2 path remains under #if !HAVE_GTK3 with direct struct access. Split the GTK3 and GTK2 branches in gtk_xtext_realize() so GTK3 uses gtk_widget_get_allocation(), gtk_widget_get_parent_window(), and gtk_widget_set_window(), while keeping the existing GTK2 struct access under #if !HAVE_GTK3. --- src/fe-gtk/xtext.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index fdb20cea..a0c546c8 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -733,7 +733,8 @@ gtk_xtext_unrealize (GtkWidget * widget) if (window) gdk_window_set_user_data (window, NULL); } -#else +#endif +#if !HAVE_GTK3 gdk_window_set_user_data (widget->window, NULL); #endif @@ -806,7 +807,8 @@ gtk_xtext_realize (GtkWidget * widget) gtk_widget_set_realized (widget, TRUE); gtk_widget_get_allocation (widget, &allocation); parent_window = gtk_widget_get_parent_window (widget); -#else +#endif +#if !HAVE_GTK3 gtk_widget_set_realized (widget, TRUE); allocation = widget->allocation; parent_window = widget->parent->window; @@ -839,7 +841,8 @@ gtk_xtext_realize (GtkWidget * widget) #if HAVE_GTK3 gtk_widget_set_window (widget, window); -#else +#endif +#if !HAVE_GTK3 widget->window = window; #endif