Fix problems with HandleBox and focusing - #78232
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com> Fix problems with HandleBox and focusing - #78232 * gtk/gtkwidget.c (gtk_widget_translate_coordinates): Handle GtkHandleBox / GnomeDock style window heirarchy / widget heirarchy disconnects. :-(. * gtk/gtkcontainer.c: Handle failures from gtk_widget_translate_coordinates (Focusing is not right, but at least it doesn't go into infinite loops.)
This commit is contained in:
parent
eb721363be
commit
c9d9db0fcc
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
Fix problems with HandleBox and focusing - #78232
|
||||||
|
|
||||||
|
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Handle
|
||||||
|
GtkHandleBox / GnomeDock style window heirarchy / widget
|
||||||
|
heirarchy disconnects. :-(.
|
||||||
|
|
||||||
|
* gtk/gtkcontainer.c: Handle failures from
|
||||||
|
gtk_widget_translate_coordinates (Focusing is not right, but at
|
||||||
|
least it doesn't go into infinite loops.)
|
||||||
|
|
||||||
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
Fix problems with HandleBox and focusing - #78232
|
||||||
|
|
||||||
|
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Handle
|
||||||
|
GtkHandleBox / GnomeDock style window heirarchy / widget
|
||||||
|
heirarchy disconnects. :-(.
|
||||||
|
|
||||||
|
* gtk/gtkcontainer.c: Handle failures from
|
||||||
|
gtk_widget_translate_coordinates (Focusing is not right, but at
|
||||||
|
least it doesn't go into infinite loops.)
|
||||||
|
|
||||||
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
Fix problems with HandleBox and focusing - #78232
|
||||||
|
|
||||||
|
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Handle
|
||||||
|
GtkHandleBox / GnomeDock style window heirarchy / widget
|
||||||
|
heirarchy disconnects. :-(.
|
||||||
|
|
||||||
|
* gtk/gtkcontainer.c: Handle failures from
|
||||||
|
gtk_widget_translate_coordinates (Focusing is not right, but at
|
||||||
|
least it doesn't go into infinite loops.)
|
||||||
|
|
||||||
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
Fix problems with HandleBox and focusing - #78232
|
||||||
|
|
||||||
|
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Handle
|
||||||
|
GtkHandleBox / GnomeDock style window heirarchy / widget
|
||||||
|
heirarchy disconnects. :-(.
|
||||||
|
|
||||||
|
* gtk/gtkcontainer.c: Handle failures from
|
||||||
|
gtk_widget_translate_coordinates (Focusing is not right, but at
|
||||||
|
least it doesn't go into infinite loops.)
|
||||||
|
|
||||||
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
Fix problems with HandleBox and focusing - #78232
|
||||||
|
|
||||||
|
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Handle
|
||||||
|
GtkHandleBox / GnomeDock style window heirarchy / widget
|
||||||
|
heirarchy disconnects. :-(.
|
||||||
|
|
||||||
|
* gtk/gtkcontainer.c: Handle failures from
|
||||||
|
gtk_widget_translate_coordinates (Focusing is not right, but at
|
||||||
|
least it doesn't go into infinite loops.)
|
||||||
|
|
||||||
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
Tue Apr 9 19:01:28 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
Fix problems with HandleBox and focusing - #78232
|
||||||
|
|
||||||
|
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Handle
|
||||||
|
GtkHandleBox / GnomeDock style window heirarchy / widget
|
||||||
|
heirarchy disconnects. :-(.
|
||||||
|
|
||||||
|
* gtk/gtkcontainer.c: Handle failures from
|
||||||
|
gtk_widget_translate_coordinates (Focusing is not right, but at
|
||||||
|
least it doesn't go into infinite loops.)
|
||||||
|
|
||||||
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 9 18:34:58 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
* gtk/gtkcontainer.c (_gtk_container_queue_resize): Always
|
||||||
|
@ -1564,8 +1564,10 @@ up_down_compare (gconstpointer a,
|
|||||||
CompareInfo *compare = data;
|
CompareInfo *compare = data;
|
||||||
gint y1, y2;
|
gint y1, y2;
|
||||||
|
|
||||||
get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1);
|
if (!get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1))
|
||||||
get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2);
|
return 0;
|
||||||
|
if (!get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2))
|
||||||
|
return 0;
|
||||||
|
|
||||||
y1 = allocation1.y + allocation1.height / 2;
|
y1 = allocation1.y + allocation1.height / 2;
|
||||||
y2 = allocation2.y + allocation2.height / 2;
|
y2 = allocation2.y + allocation2.height / 2;
|
||||||
@ -1592,6 +1594,7 @@ gtk_container_focus_sort_up_down (GtkContainer *container,
|
|||||||
{
|
{
|
||||||
CompareInfo compare;
|
CompareInfo compare;
|
||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
|
GdkRectangle old_allocation;
|
||||||
|
|
||||||
compare.container = container;
|
compare.container = container;
|
||||||
compare.reverse = (direction == GTK_DIR_UP);
|
compare.reverse = (direction == GTK_DIR_UP);
|
||||||
@ -1599,17 +1602,14 @@ gtk_container_focus_sort_up_down (GtkContainer *container,
|
|||||||
if (!old_focus)
|
if (!old_focus)
|
||||||
old_focus = find_old_focus (container, children);
|
old_focus = find_old_focus (container, children);
|
||||||
|
|
||||||
if (old_focus)
|
if (old_focus && get_allocation_coords (container, old_focus, &old_allocation))
|
||||||
{
|
{
|
||||||
GdkRectangle old_allocation;
|
|
||||||
gint compare_x1;
|
gint compare_x1;
|
||||||
gint compare_x2;
|
gint compare_x2;
|
||||||
gint compare_y;
|
gint compare_y;
|
||||||
|
|
||||||
/* Delete widgets from list that don't match minimum criteria */
|
/* Delete widgets from list that don't match minimum criteria */
|
||||||
|
|
||||||
get_allocation_coords (container, old_focus, &old_allocation);
|
|
||||||
|
|
||||||
compare_x1 = old_allocation.x;
|
compare_x1 = old_allocation.x;
|
||||||
compare_x2 = old_allocation.x + old_allocation.width;
|
compare_x2 = old_allocation.x + old_allocation.width;
|
||||||
|
|
||||||
@ -1628,8 +1628,8 @@ gtk_container_focus_sort_up_down (GtkContainer *container,
|
|||||||
|
|
||||||
if (child != old_focus)
|
if (child != old_focus)
|
||||||
{
|
{
|
||||||
get_allocation_coords (container, child, &child_allocation);
|
if (get_allocation_coords (container, child, &child_allocation))
|
||||||
|
{
|
||||||
child_x1 = child_allocation.x;
|
child_x1 = child_allocation.x;
|
||||||
child_x2 = child_allocation.x + child_allocation.width;
|
child_x2 = child_allocation.x + child_allocation.width;
|
||||||
|
|
||||||
@ -1640,6 +1640,9 @@ gtk_container_focus_sort_up_down (GtkContainer *container,
|
|||||||
children = g_list_delete_link (children, tmp_list);
|
children = g_list_delete_link (children, tmp_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
children = g_list_delete_link (children, tmp_list);
|
||||||
|
}
|
||||||
|
|
||||||
tmp_list = next;
|
tmp_list = next;
|
||||||
}
|
}
|
||||||
@ -1690,8 +1693,10 @@ left_right_compare (gconstpointer a,
|
|||||||
CompareInfo *compare = data;
|
CompareInfo *compare = data;
|
||||||
gint x1, x2;
|
gint x1, x2;
|
||||||
|
|
||||||
get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1);
|
if (!get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1))
|
||||||
get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2);
|
return 0;
|
||||||
|
if (!get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2))
|
||||||
|
return 0;
|
||||||
|
|
||||||
x1 = allocation1.x + allocation1.width / 2;
|
x1 = allocation1.x + allocation1.width / 2;
|
||||||
x2 = allocation2.x + allocation2.width / 2;
|
x2 = allocation2.x + allocation2.width / 2;
|
||||||
@ -1718,6 +1723,7 @@ gtk_container_focus_sort_left_right (GtkContainer *container,
|
|||||||
{
|
{
|
||||||
CompareInfo compare;
|
CompareInfo compare;
|
||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
|
GdkRectangle old_allocation;
|
||||||
|
|
||||||
compare.container = container;
|
compare.container = container;
|
||||||
compare.reverse = (direction == GTK_DIR_LEFT);
|
compare.reverse = (direction == GTK_DIR_LEFT);
|
||||||
@ -1725,18 +1731,14 @@ gtk_container_focus_sort_left_right (GtkContainer *container,
|
|||||||
if (!old_focus)
|
if (!old_focus)
|
||||||
old_focus = find_old_focus (container, children);
|
old_focus = find_old_focus (container, children);
|
||||||
|
|
||||||
if (old_focus)
|
if (old_focus && get_allocation_coords (container, old_focus, &old_allocation))
|
||||||
{
|
{
|
||||||
GdkRectangle old_allocation;
|
|
||||||
|
|
||||||
gint compare_y1;
|
gint compare_y1;
|
||||||
gint compare_y2;
|
gint compare_y2;
|
||||||
gint compare_x;
|
gint compare_x;
|
||||||
|
|
||||||
/* Delete widgets from list that don't match minimum criteria */
|
/* Delete widgets from list that don't match minimum criteria */
|
||||||
|
|
||||||
get_allocation_coords (container, old_focus, &old_allocation);
|
|
||||||
|
|
||||||
compare_y1 = old_allocation.y;
|
compare_y1 = old_allocation.y;
|
||||||
compare_y2 = old_allocation.y + old_allocation.height;
|
compare_y2 = old_allocation.y + old_allocation.height;
|
||||||
|
|
||||||
@ -1755,8 +1757,8 @@ gtk_container_focus_sort_left_right (GtkContainer *container,
|
|||||||
|
|
||||||
if (child != old_focus)
|
if (child != old_focus)
|
||||||
{
|
{
|
||||||
get_allocation_coords (container, child, &child_allocation);
|
if (get_allocation_coords (container, child, &child_allocation))
|
||||||
|
{
|
||||||
child_y1 = child_allocation.y;
|
child_y1 = child_allocation.y;
|
||||||
child_y2 = child_allocation.y + child_allocation.height;
|
child_y2 = child_allocation.y + child_allocation.height;
|
||||||
|
|
||||||
@ -1767,6 +1769,9 @@ gtk_container_focus_sort_left_right (GtkContainer *container,
|
|||||||
children = g_list_delete_link (children, tmp_list);
|
children = g_list_delete_link (children, tmp_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
children = g_list_delete_link (children, tmp_list);
|
||||||
|
}
|
||||||
|
|
||||||
tmp_list = next;
|
tmp_list = next;
|
||||||
}
|
}
|
||||||
|
@ -2481,6 +2481,9 @@ gtk_widget_translate_coordinates (GtkWidget *src_widget,
|
|||||||
src_y += dy;
|
src_y += dy;
|
||||||
|
|
||||||
window = gdk_window_get_parent (window);
|
window = gdk_window_get_parent (window);
|
||||||
|
|
||||||
|
if (!window) /* Handle GtkHandleBox */
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* And back */
|
/* And back */
|
||||||
@ -2495,6 +2498,9 @@ gtk_widget_translate_coordinates (GtkWidget *src_widget,
|
|||||||
src_y -= dy;
|
src_y -= dy;
|
||||||
|
|
||||||
window = gdk_window_get_parent (window);
|
window = gdk_window_get_parent (window);
|
||||||
|
|
||||||
|
if (!window) /* Handle GtkHandleBox */
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Translate from window relative to allocation relative */
|
/* Translate from window relative to allocation relative */
|
||||||
|
Loading…
Reference in New Issue
Block a user