+Wed Feb 11 02:23:39 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcontainer.c (gtk_container_real_set_focus_child): Handle
+ focus [hv]adjustment correctly when the focus is located deeper
+ down in the hierarchy. (#133489)
+
Wed Feb 11 02:06:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): Remove
* tests/prop-editor.c (create_prop_editor): Free the title.
(object_changed): Free the children list.
->>>>>>> 1.4914
Tue Feb 10 01:58:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_set_focus_hadjustment):
+Wed Feb 11 02:23:39 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcontainer.c (gtk_container_real_set_focus_child): Handle
+ focus [hv]adjustment correctly when the focus is located deeper
+ down in the hierarchy. (#133489)
+
Wed Feb 11 02:06:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): Remove
* tests/prop-editor.c (create_prop_editor): Free the title.
(object_changed): Free the children list.
->>>>>>> 1.4914
Tue Feb 10 01:58:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_set_focus_hadjustment):
+Wed Feb 11 02:23:39 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcontainer.c (gtk_container_real_set_focus_child): Handle
+ focus [hv]adjustment correctly when the focus is located deeper
+ down in the hierarchy. (#133489)
+
Wed Feb 11 02:06:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): Remove
* tests/prop-editor.c (create_prop_editor): Free the title.
(object_changed): Free the children list.
->>>>>>> 1.4914
Tue Feb 10 01:58:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_set_focus_hadjustment):
+Wed Feb 11 02:23:39 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcontainer.c (gtk_container_real_set_focus_child): Handle
+ focus [hv]adjustment correctly when the focus is located deeper
+ down in the hierarchy. (#133489)
+
Wed Feb 11 02:06:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): Remove
* tests/prop-editor.c (create_prop_editor): Free the title.
(object_changed): Free the children list.
->>>>>>> 1.4914
Tue Feb 10 01:58:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_set_focus_hadjustment):
+Wed Feb 11 02:23:39 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcontainer.c (gtk_container_real_set_focus_child): Handle
+ focus [hv]adjustment correctly when the focus is located deeper
+ down in the hierarchy. (#133489)
+
Wed Feb 11 02:06:38 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcellrenderer.c (gtk_cell_renderer_class_init): Remove
* tests/prop-editor.c (create_prop_editor): Free the title.
(object_changed): Free the children list.
->>>>>>> 1.4914
Tue Feb 10 01:58:55 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcontainer.c (gtk_container_set_focus_hadjustment):
GtkWidget *child)
{
g_return_if_fail (GTK_IS_CONTAINER (container));
- if (child)
- g_return_if_fail (GTK_IS_WIDGET (child));
+ g_return_if_fail (child == NULL || GTK_IS_WIDGET (child));
if (child != container->focus_child)
{
*/
if (container->focus_child)
{
- GtkAdjustment *adjustment;
-
- adjustment = g_object_get_qdata (G_OBJECT (container), vadjustment_key_id);
- if (adjustment)
- gtk_adjustment_clamp_page (adjustment,
- container->focus_child->allocation.y,
- (container->focus_child->allocation.y +
- container->focus_child->allocation.height));
-
- adjustment = g_object_get_qdata (G_OBJECT (container), hadjustment_key_id);
- if (adjustment)
- gtk_adjustment_clamp_page (adjustment,
- container->focus_child->allocation.x,
- (container->focus_child->allocation.x +
- container->focus_child->allocation.width));
+ GtkAdjustment *hadj;
+ GtkAdjustment *vadj;
+ GtkWidget *focus_child;
+ gint x, y;
+
+ hadj = g_object_get_qdata (G_OBJECT (container), hadjustment_key_id);
+ vadj = g_object_get_qdata (G_OBJECT (container), vadjustment_key_id);
+ if (hadj || vadj)
+ {
+
+ focus_child = container->focus_child;
+ while (GTK_IS_CONTAINER (focus_child) &&
+ GTK_CONTAINER (focus_child)->focus_child)
+ {
+ focus_child = GTK_CONTAINER (focus_child)->focus_child;
+ }
+
+ gtk_widget_translate_coordinates (focus_child, container->focus_child,
+ 0, 0, &x, &y);
+
+ x += container->focus_child->allocation.x;
+ y += container->focus_child->allocation.y;
+
+ if (vadj)
+ gtk_adjustment_clamp_page (vadj, y, y + focus_child->allocation.height);
+
+ if (hadj)
+ gtk_adjustment_clamp_page (hadj, x, x + focus_child->allocation.width);
+ }
}
}