Moved gtk_widget_set_realized() into the GTK3 branch and used GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED) for GTK2, keeping allocation/parent-window access split by #if HAVE_GTK3

This commit is contained in:
2026-01-23 21:52:40 -07:00
parent 1d32aed8dc
commit f65f350965

View File

@@ -800,13 +800,14 @@ gtk_xtext_realize (GtkWidget * widget)
GdkWindow *parent_window; GdkWindow *parent_window;
gint attributes_mask; gint attributes_mask;
gtk_widget_set_realized (widget, TRUE);
xtext = GTK_XTEXT (widget); xtext = GTK_XTEXT (widget);
#if HAVE_GTK3 #if HAVE_GTK3
gtk_widget_set_realized (widget, TRUE);
gtk_widget_get_allocation (widget, &allocation); gtk_widget_get_allocation (widget, &allocation);
parent_window = gtk_widget_get_parent_window (widget); parent_window = gtk_widget_get_parent_window (widget);
#else #else
gtk_widget_set_realized (widget, TRUE);
allocation = widget->allocation; allocation = widget->allocation;
parent_window = widget->parent->window; parent_window = widget->parent->window;
#endif #endif