changeset 1919:78a65391dbcb

More GTK3 MDI fixes... remove duplicate code... Transition to gtk_render_background() in draw().
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 28 Sep 2016 23:23:57 +0000
parents 1814a6577a5f
children 31179c5a3c5a
files gtk3/dw.c
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gtk3/dw.c	Wed Sep 28 22:58:41 2016 +0000
+++ b/gtk3/dw.c	Wed Sep 28 23:23:57 2016 +0000
@@ -427,7 +427,6 @@
    for (j = 0; j < 3; j++)
    {
       _dw_override_color (button[j], "background-color", &color);
-      _dw_override_color (button[j], "background-color", &color);
    }
    gdk_rgba_parse (&color, GTK_MDI_LABEL_FOREGROUND);
    _dw_override_color (label, "color", &color);
@@ -582,7 +581,7 @@
    GdkWindowAttr attributes;
    gint attributes_mask;
    GdkWindow *thiswindow;
-   GtkStyleContext *context;
+   GtkAllocation allocation;
 
    mdi = GTK_MDI (widget);
 
@@ -591,7 +590,6 @@
 
    gtk_widget_set_realized(widget, TRUE);
 
-   GtkAllocation allocation;
    gtk_widget_get_allocation(widget, &allocation);
    attributes.x = allocation.x;
    attributes.y = allocation.y;
@@ -610,9 +608,6 @@
    gtk_widget_set_window(widget, thiswindow);
    
    gdk_window_set_user_data (gtk_widget_get_window(widget), widget);
-
-   if((context = gtk_widget_get_style_context(widget)))
-      gtk_style_context_set_background (context, gtk_widget_get_window(widget));
 }
 
 static void gtk_mdi_get_preferred_width (GtkWidget *widget, gint *minimum_width, gint *natural_width)
@@ -747,12 +742,22 @@
    GtkMdiChild *child;
    GList *children;
    GtkMdi *mdi;
+   GtkStyleContext *context;
 
    g_return_val_if_fail (widget != NULL, FALSE);
    g_return_val_if_fail (GTK_IS_MDI (widget), FALSE);
    g_return_val_if_fail (cr != NULL, FALSE);
 
    mdi = GTK_MDI (widget);
+
+   if((context = gtk_widget_get_style_context(widget)))
+   {
+      GtkAllocation allocation;
+
+      gtk_widget_get_allocation (widget, &allocation);
+      gtk_render_background (context, cr, 0, 0, allocation.x, allocation.y);
+   }
+
    for (children = mdi->children; children; children = children->next)
    {
       child = (GtkMdiChild *) children->data;