summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-04-07 12:16:20 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-04-07 12:16:20 +0000
commit8af0782261aed47f3084f24dec4fcf7c32df6dc7 (patch)
tree15e84683a0f3c59d33b9dd4089be7223b4f504c5
parentdf18223487eb9726d5bb9afca602f74f34c72c96 (diff)
downloadgtk+-8af0782261aed47f3084f24dec4fcf7c32df6dc7.tar.gz
treeview: Make expanders work again
These were broken by the crossing event unification. We are now generating some more crossing events, and the treeview was not looking closely enough at the ones it gets. Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1814
-rw-r--r--gtk/gtktreeview.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index a1eda1d11b..19c085a1c1 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5472,15 +5472,21 @@ gtk_tree_view_motion_controller_leave (GtkEventControllerMotion *controller,
GdkNotifyType detail,
GtkTreeView *tree_view)
{
+ gboolean is_focus, contains_focus;
+
if (tree_view->priv->prelight_node)
gtk_widget_queue_draw (GTK_WIDGET (tree_view));
tree_view->priv->event_last_x = -10000;
tree_view->priv->event_last_y = -10000;
- prelight_or_select (tree_view,
- NULL, NULL,
- -1000, -1000); /* coords not possibly over an arrow */
+ g_object_get (controller,
+ "is-pointer-focus", &is_focus,
+ "contains-pointer-focus", &contains_focus,
+ NULL);
+
+ if (!is_focus && !contains_focus)
+ prelight_or_select (tree_view, NULL, NULL, -1000, -1000); /* not possibly over an arrow */
}
static void
@@ -5489,10 +5495,18 @@ gtk_tree_view_key_controller_focus_out (GtkEventControllerKey *key,
GdkNotifyType detail,
GtkTreeView *tree_view)
{
+ gboolean is_focus, contains_focus;
+
gtk_widget_queue_draw (GTK_WIDGET (tree_view));
+ g_object_get (key,
+ "is-focus", &is_focus,
+ "contains-focus", &contains_focus,
+ NULL);
+
/* destroy interactive search dialog */
- if (tree_view->priv->search_window)
+ if (tree_view->priv->search_window &&
+ !is_focus && !contains_focus)
gtk_tree_view_search_window_hide (tree_view->priv->search_window, tree_view,
gtk_get_current_event_device ());
}