Bug 541391 – Unfocussable Treeview swallows focus

* gtk/gtktreeview.c (grab_focus_and_unset_draw_keyfocus),
(gtk_tree_view_focus): Honor GTK_WIDGET_CAN_FOCUS properly

svn path=/trunk/; revision=21507
This commit is contained in:
Christian Dywan 2008-09-24 08:19:51 +00:00
parent bbc726431d
commit 0c5bfe5f2b
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2008-09-24 Christian Dywan <christian@imendio.com>
Bug 541391 Unfocussable Treeview swallows focus
* gtk/gtktreeview.c (grab_focus_and_unset_draw_keyfocus),
(gtk_tree_view_focus): Honor GTK_WIDGET_CAN_FOCUS properly
2008-09-24 Denis Washington <denisw@svn.gnome.org>
* gtk/gtkiconview.c: draw focus as a rectangle around the

View File

@ -2461,7 +2461,7 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
static void
grab_focus_and_unset_draw_keyfocus (GtkTreeView *tree_view)
{
if (!GTK_WIDGET_HAS_FOCUS (tree_view))
if (GTK_WIDGET_CAN_FOCUS (tree_view) && !GTK_WIDGET_HAS_FOCUS (tree_view))
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
}
@ -7837,7 +7837,7 @@ gtk_tree_view_focus (GtkWidget *widget,
GtkContainer *container = GTK_CONTAINER (widget);
GtkWidget *focus_child;
if (!GTK_WIDGET_IS_SENSITIVE (container))
if (!GTK_WIDGET_IS_SENSITIVE (container) || !GTK_WIDGET_CAN_FOCUS (widget))
return FALSE;
focus_child = container->focus_child;