Updating branch refs/heads/master to 585dc915b8a792170ca423405689a3823804f28f (commit) from 6df44d29a4e8bda569d371ad3050f4a31c964dd0 (commit)
commit 585dc915b8a792170ca423405689a3823804f28f Author: Nick Schermer <n...@xfce.org> Date: Thu Sep 20 19:33:20 2012 +0200 Fix background color in gtk2 header code. Removed a bit too much code. libxfce4ui/xfce-heading.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/libxfce4ui/xfce-heading.c b/libxfce4ui/xfce-heading.c index 83e1de7..afcfff5 100644 --- a/libxfce4ui/xfce-heading.c +++ b/libxfce4ui/xfce-heading.c @@ -156,20 +156,38 @@ _xfce_heading_realize (GtkWidget *widget) attributes.y = allocation.y; attributes.width = allocation.width; attributes.height = allocation.height; +#if !GTK_CHECK_VERSION (3, 0, 0) + attributes.colormap = gtk_widget_get_colormap (widget); +#endif attributes.wclass = GDK_INPUT_OUTPUT; attributes.window_type = GDK_WINDOW_CHILD; attributes.visual = gtk_widget_get_visual (widget); attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; +#if GTK_CHECK_VERSION (3, 0, 0) /* allocate the widget window */ window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL); gtk_widget_set_window (widget, window); gdk_window_set_user_data (window, widget); +#else + /* allocate the widget window */ + window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, + GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP); + gtk_widget_set_window (widget, window); + gdk_window_set_user_data (window, widget); + + /* connect the style to the window */ + widget->style = gtk_style_attach (widget->style, widget->window); + + /* set background color (using the base color) */ + gdk_window_set_background (widget->window, &widget->style->base[GTK_STATE_NORMAL]); +#endif } + #if GTK_CHECK_VERSION (3, 0, 0) static void _xfce_heading_get_preferred_width (GtkWidget *widget, _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits