[gtk+/gtk-3-20] treeview: Ensure the treeview has the implicit grab before grabbing focus
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-20] treeview: Ensure the treeview has the implicit grab before grabbing focus
- Date: Thu, 4 Aug 2016 15:39:33 +0000 (UTC)
commit 86ece2979701c07a2f1ab2562f2307f07140921e
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jun 13 23:44:31 2016 +0200
treeview: Ensure the treeview has the implicit grab before grabbing focus
The cellrenderer signals might be taking the grab somewhere else, at which
point it's dubious we should attempt to take the keyboard focus into the
treeview.
This concretely breaks popovers triggered from cellrenderer signals on
button press, because the treeview will attempt to grab focus
inconditionally then.
https://bugzilla.gnome.org/show_bug.cgi?id=767468
gtk/gtktreeview.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 14fb470..61d7b09 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -3050,9 +3050,13 @@ static void
grab_focus_and_unset_draw_keyfocus (GtkTreeView *tree_view)
{
GtkWidget *widget = GTK_WIDGET (tree_view);
+ GtkWidget *grab_widget = gtk_grab_get_current ();
- if (gtk_widget_get_can_focus (widget) && !gtk_widget_has_focus (widget))
+ if (gtk_widget_get_can_focus (widget) &&
+ !gtk_widget_has_focus (widget) &&
+ (!grab_widget || grab_widget == widget))
gtk_widget_grab_focus (widget);
+
tree_view->priv->draw_keyfocus = 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]