summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--gtk/gtkcontainer.c27
3 files changed, 25 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index eb48ed7df..1661b8ee7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-14 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkcontainer.c (_gtk_container_focus_sort): Skip unrealized
+ children when doing focus sorting. (#323995, Dan Winship)
+
2005-12-14 Rodney Dawes <dobey@novell.com>
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_volume_render_icon):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index eb48ed7df..1661b8ee7 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,8 @@
+2005-12-14 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkcontainer.c (_gtk_container_focus_sort): Skip unrealized
+ children when doing focus sorting. (#323995, Dan Winship)
+
2005-12-14 Rodney Dawes <dobey@novell.com>
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_volume_render_icon):
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 7f7bff9d3..e246b498f 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1706,10 +1706,8 @@ up_down_compare (gconstpointer a,
CompareInfo *compare = data;
gint y1, y2;
- if (!get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1))
- return 0;
- if (!get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2))
- return 0;
+ get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1);
+ get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2);
y1 = allocation1.y + allocation1.height / 2;
y2 = allocation2.y + allocation2.height / 2;
@@ -1835,10 +1833,8 @@ left_right_compare (gconstpointer a,
CompareInfo *compare = data;
gint x1, x2;
- if (!get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1))
- return 0;
- if (!get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2))
- return 0;
+ get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1);
+ get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2);
x1 = allocation1.x + allocation1.width / 2;
x2 = allocation2.x + allocation2.width / 2;
@@ -1979,19 +1975,26 @@ _gtk_container_focus_sort (GtkContainer *container,
GtkDirectionType direction,
GtkWidget *old_focus)
{
- children = g_list_copy (children);
+ GList *visible_children = NULL;
+
+ while (children)
+ {
+ if (GTK_WIDGET_REALIZED (children->data))
+ visible_children = g_list_prepend (visible_children, children->data);
+ children = children->next;
+ }
switch (direction)
{
case GTK_DIR_TAB_FORWARD:
case GTK_DIR_TAB_BACKWARD:
- return gtk_container_focus_sort_tab (container, children, direction, old_focus);
+ return gtk_container_focus_sort_tab (container, visible_children, direction, old_focus);
case GTK_DIR_UP:
case GTK_DIR_DOWN:
- return gtk_container_focus_sort_up_down (container, children, direction, old_focus);
+ return gtk_container_focus_sort_up_down (container, visible_children, direction, old_focus);
case GTK_DIR_LEFT:
case GTK_DIR_RIGHT:
- return gtk_container_focus_sort_left_right (container, children, direction, old_focus);
+ return gtk_container_focus_sort_left_right (container, visible_children, direction, old_focus);
}
g_assert_not_reached ();