mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Consolidated GTK3 realization setup to use parent window/visual and keep GTK2-only colormap/parent window under the GTK2 branch in gtk_xtext_realize.
This commit is contained in:
@@ -878,9 +878,14 @@ gtk_xtext_realize (GtkWidget * widget)
|
|||||||
#if HAVE_GTK3
|
#if HAVE_GTK3
|
||||||
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);
|
||||||
|
attributes.visual = gtk_widget_get_visual (widget);
|
||||||
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
|
||||||
#else
|
#else
|
||||||
allocation = widget->allocation;
|
allocation = widget->allocation;
|
||||||
parent_window = widget->parent->window;
|
parent_window = widget->parent->window;
|
||||||
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
||||||
|
attributes.visual = gtk_widget_get_visual (widget);
|
||||||
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
attributes.x = allocation.x;
|
attributes.x = allocation.x;
|
||||||
@@ -893,19 +898,6 @@ gtk_xtext_realize (GtkWidget * widget)
|
|||||||
GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
|
GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
|
||||||
| GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK;
|
| GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK;
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
#if HAVE_GTK3
|
|
||||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
|
|
||||||
#else
|
|
||||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
window = gdk_window_new (parent_window, &attributes, attributes_mask);
|
window = gdk_window_new (parent_window, &attributes, attributes_mask);
|
||||||
|
|
||||||
#if HAVE_GTK3
|
#if HAVE_GTK3
|
||||||
|
|||||||
Reference in New Issue
Block a user