Fixed focus handling on embedded windows.

Now GtkWindow chains up in focus vfuncs when non-toplevel, this
fixes focus in testtoplevelembed.
This commit is contained in:
Tristan Van Berkom
2010-12-24 13:25:02 +09:00
parent 387d745e0e
commit aa787c9dd1
2 changed files with 10 additions and 3 deletions

View File

@ -5996,6 +5996,9 @@ gtk_window_focus (GtkWidget *widget,
GtkWidget *old_focus_child;
GtkWidget *parent;
if (!gtk_widget_is_toplevel (GTK_WIDGET (widget)))
return GTK_WIDGET_CLASS (gtk_window_parent_class)->focus (widget, direction);
container = GTK_CONTAINER (widget);
window = GTK_WINDOW (widget);
priv = window->priv;
@ -6049,6 +6052,12 @@ static void
gtk_window_move_focus (GtkWidget *widget,
GtkDirectionType dir)
{
if (!gtk_widget_is_toplevel (GTK_WIDGET (widget)))
{
GTK_WIDGET_CLASS (gtk_window_parent_class)->move_focus (widget, dir);
return;
}
gtk_widget_child_focus (widget, dir);
if (! gtk_container_get_focus_child (GTK_CONTAINER (widget)))