[gtk+] notebook: Reorder expose function in preparation of draw vfunc



commit c46ce9714519c5c4dadbcd2a1ab84574eb3af778
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 6 23:18:14 2010 +0200

    notebook: Reorder expose function in preparation of draw vfunc

 gtk/gtknotebook.c |   53 +++++++++++++++++++++++++++--------------------------
 1 files changed, 27 insertions(+), 26 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 1282081..9b4ad40 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2249,32 +2249,7 @@ gtk_notebook_expose (GtkWidget      *widget,
   GtkNotebookPrivate *priv = notebook->priv;
   gint i;
 
-  if (event->window == priv->drag_window)
-    {
-      GdkRectangle area = { 0, };
-      cairo_t *cr;
-
-      /* FIXME: This is a workaround to make tabs reordering work better
-       * with engines with rounded tabs. If the drag window background
-       * isn't set, the rounded corners would be black.
-       *
-       * Ideally, these corners should be made transparent, Either by using
-       * ARGB visuals or shape windows.
-       */
-      cr = gdk_cairo_create (priv->drag_window);
-      gdk_cairo_set_source_color (cr, &gtk_widget_get_style(widget)->bg [GTK_STATE_NORMAL]);
-      cairo_paint (cr);
-      cairo_destroy (cr);
-
-      gdk_drawable_get_size (priv->drag_window,
-			     &area.width, &area.height);
-      gtk_notebook_draw_tab (notebook,
-			     priv->cur_page,
-			     &area);
-      gtk_container_propagate_expose (GTK_CONTAINER (notebook),
-				      priv->cur_page->tab_label, event);
-    }
-  else if (gtk_widget_is_drawable (widget))
+  if (gtk_widget_is_drawable (widget))
     {
       gtk_notebook_paint (widget, &event->area);
       if (priv->show_tabs)
@@ -2309,6 +2284,32 @@ gtk_notebook_expose (GtkWidget      *widget,
       }
     }
 
+  if (event->window == priv->drag_window)
+    {
+      GdkRectangle area = { 0, };
+      cairo_t *cr;
+
+      /* FIXME: This is a workaround to make tabs reordering work better
+       * with engines with rounded tabs. If the drag window background
+       * isn't set, the rounded corners would be black.
+       *
+       * Ideally, these corners should be made transparent, Either by using
+       * ARGB visuals or shape windows.
+       */
+      cr = gdk_cairo_create (priv->drag_window);
+      gdk_cairo_set_source_color (cr, &gtk_widget_get_style (widget)->bg [GTK_STATE_NORMAL]);
+      cairo_paint (cr);
+      cairo_destroy (cr);
+
+      gdk_drawable_get_size (priv->drag_window,
+			     &area.width, &area.height);
+      gtk_notebook_draw_tab (notebook,
+			     priv->cur_page,
+			     &area);
+      gtk_container_propagate_expose (GTK_CONTAINER (notebook),
+				      priv->cur_page->tab_label, event);
+    }
+  
   return FALSE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]