Commit 09b83718 authored by Sébastien Lafargue's avatar Sébastien Lafargue

textview: Fix drag highlight problems

parent a84926f0
...@@ -1750,7 +1750,8 @@ gtk_text_view_init (GtkTextView *text_view) ...@@ -1750,7 +1750,8 @@ gtk_text_view_init (GtkTextView *text_view)
priv->selection_node = gtk_css_node_new (); priv->selection_node = gtk_css_node_new ();
gtk_css_node_set_name (priv->selection_node, I_("selection")); gtk_css_node_set_name (priv->selection_node, I_("selection"));
gtk_css_node_set_parent (priv->selection_node, priv->text_window->css_node); gtk_css_node_set_parent (priv->selection_node, priv->text_window->css_node);
gtk_css_node_set_state (priv->selection_node, gtk_css_node_get_state (priv->text_window->css_node)); gtk_css_node_set_state (priv->selection_node,
gtk_css_node_get_state (priv->text_window->css_node) & ~GTK_STATE_FLAG_DROP_ACTIVE);
gtk_css_node_set_visible (priv->selection_node, FALSE); gtk_css_node_set_visible (priv->selection_node, FALSE);
g_object_unref (priv->selection_node); g_object_unref (priv->selection_node);
} }
...@@ -4922,6 +4923,9 @@ gtk_text_view_state_flags_changed (GtkWidget *widget, ...@@ -4922,6 +4923,9 @@ gtk_text_view_state_flags_changed (GtkWidget *widget,
state = gtk_widget_get_state_flags (widget); state = gtk_widget_get_state_flags (widget);
gtk_css_node_set_state (priv->text_window->css_node, state); gtk_css_node_set_state (priv->text_window->css_node, state);
state &= ~GTK_STATE_FLAG_DROP_ACTIVE;
gtk_css_node_set_state (priv->selection_node, state); gtk_css_node_set_state (priv->selection_node, state);
if (priv->left_window) if (priv->left_window)
gtk_css_node_set_state (priv->left_window->css_node, state); gtk_css_node_set_state (priv->left_window->css_node, state);
...@@ -8318,6 +8322,8 @@ gtk_text_view_drag_leave (GtkWidget *widget, ...@@ -8318,6 +8322,8 @@ gtk_text_view_drag_leave (GtkWidget *widget,
g_source_remove (priv->scroll_timeout); g_source_remove (priv->scroll_timeout);
priv->scroll_timeout = 0; priv->scroll_timeout = 0;
gtk_drag_unhighlight (widget);
} }
static gboolean static gboolean
...@@ -8420,6 +8426,8 @@ gtk_text_view_drag_motion (GtkWidget *widget, ...@@ -8420,6 +8426,8 @@ gtk_text_view_drag_motion (GtkWidget *widget,
g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] drag_scan_timeout"); g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] drag_scan_timeout");
} }
gtk_drag_highlight (widget);
/* TRUE return means don't propagate the drag motion to parent /* TRUE return means don't propagate the drag motion to parent
* widgets that may also be drop sites. * widgets that may also be drop sites.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment