]> Pileus Git - ~andy/gtk/commitdiff
Invalidate the window if the tree is empty, to avoid resizing artifacts
authorMatthias Clasen <mclasen@redhat.com>
Sun, 24 Oct 2004 00:43:48 +0000 (00:43 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 24 Oct 2004 00:43:48 +0000 (00:43 +0000)
2004-10-23  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate
the window if the tree is empty, to avoid resizing artifacts
from the focus rectangle.  (#155881, Vincent Noel, patch by
Billy Biggs)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreeview.c

index 4640ec6460098859cbca4a9e94ded89b2127f656..626abcbb54f19030ffa87498d915199c61b515a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-10-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate 
+       the window if the tree is empty, to avoid resizing artifacts
+       from the focus rectangle.  (#155881, Vincent Noel, patch by
+       Billy Biggs)    
+
 Sat Oct 23 16:14:37 2004  Søren Sandmann  <sandmann@redhat.com>
 
        * gtk/gtksequence.c (_gtk_sequence_node_insert_sorted): Remove
index 4640ec6460098859cbca4a9e94ded89b2127f656..626abcbb54f19030ffa87498d915199c61b515a7 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate 
+       the window if the tree is empty, to avoid resizing artifacts
+       from the focus rectangle.  (#155881, Vincent Noel, patch by
+       Billy Biggs)    
+
 Sat Oct 23 16:14:37 2004  Søren Sandmann  <sandmann@redhat.com>
 
        * gtk/gtksequence.c (_gtk_sequence_node_insert_sorted): Remove
index 4640ec6460098859cbca4a9e94ded89b2127f656..626abcbb54f19030ffa87498d915199c61b515a7 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate 
+       the window if the tree is empty, to avoid resizing artifacts
+       from the focus rectangle.  (#155881, Vincent Noel, patch by
+       Billy Biggs)    
+
 Sat Oct 23 16:14:37 2004  Søren Sandmann  <sandmann@redhat.com>
 
        * gtk/gtksequence.c (_gtk_sequence_node_insert_sorted): Remove
index 4640ec6460098859cbca4a9e94ded89b2127f656..626abcbb54f19030ffa87498d915199c61b515a7 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_size_allocate): Invalidate 
+       the window if the tree is empty, to avoid resizing artifacts
+       from the focus rectangle.  (#155881, Vincent Noel, patch by
+       Billy Biggs)    
+
 Sat Oct 23 16:14:37 2004  Søren Sandmann  <sandmann@redhat.com>
 
        * gtk/gtksequence.c (_gtk_sequence_node_insert_sorted): Remove
index 1eb1a3e9bb1f6a0dd90043b738e4857e7f240632..be4135cd0473bb573347ed5b31c26f703bd9761a 100644 (file)
@@ -288,7 +288,7 @@ static void     install_presize_handler  (GtkTreeView *tree_view);
 static void     install_scroll_sync_handler (GtkTreeView *tree_view);
 static void    gtk_tree_view_dy_to_top_row (GtkTreeView *tree_view);
 static void     gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view);
-
+static void     invalidate_empty_focus      (GtkTreeView *tree_view);
 
 /* Internal functions */
 static gboolean gtk_tree_view_is_expander_column             (GtkTreeView       *tree_view,
@@ -2109,6 +2109,9 @@ gtk_tree_view_size_allocate (GtkWidget     *widget,
 
   gtk_tree_view_size_allocate_columns (widget);
 
+  if (tree_view->priv->tree == NULL)
+    invalidate_empty_focus (tree_view);
+
   if (GTK_WIDGET_REALIZED (widget))
     {
       gboolean has_expand_column = FALSE;
@@ -3353,6 +3356,23 @@ gtk_tree_view_motion (GtkWidget      *widget,
   return FALSE;
 }
 
+/* Invalidate the focus rectangle near the edge of the bin_window; used when
+ * the tree is empty.
+ */
+static void
+invalidate_empty_focus (GtkTreeView *tree_view)
+{
+  GdkRectangle area;
+
+  if (!GTK_WIDGET_HAS_FOCUS (tree_view))
+    return;
+
+  area.x = 0;
+  area.y = 0;
+  gdk_drawable_get_size (tree_view->priv->bin_window, &area.width, &area.height);
+  gdk_window_invalidate_rect (tree_view->priv->bin_window, &area, FALSE);
+}
+
 /* Draws a focus rectangle near the edge of the bin_window; used when the tree
  * is empty.
  */