From c0c0b2ec4c0965ccdbf73f6246927957697294ea Mon Sep 17 00:00:00 2001 From: deepend Date: Thu, 29 Jan 2026 23:06:21 -0700 Subject: [PATCH] Moved GTK2-only parent window and colormap handling into the GTK2 code path while keeping GTK3 setup relying on gtk_widget_get_parent_window and visual-only attributes in gtk_xtext_realize. --- src/fe-gtk/xtext.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 6a77c37f..0ade632b 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -874,13 +874,11 @@ gtk_xtext_realize (GtkWidget * widget) xtext = GTK_XTEXT (widget); -#if HAVE_GTK3 gtk_widget_set_realized (widget, TRUE); +#if HAVE_GTK3 gtk_widget_get_allocation (widget, &allocation); parent_window = gtk_widget_get_parent_window (widget); -#endif -#if !HAVE_GTK3 - gtk_widget_set_realized (widget, TRUE); +#else allocation = widget->allocation; parent_window = widget->parent->window; #endif @@ -895,10 +893,10 @@ gtk_xtext_realize (GtkWidget * widget) GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK; -#if !HAVE_GTK3 - attributes.colormap = gtk_widget_get_colormap (widget); +#if HAVE_GTK3 attributes.visual = gtk_widget_get_visual (widget); #else + attributes.colormap = gtk_widget_get_colormap (widget); attributes.visual = gtk_widget_get_visual (widget); #endif