From 67b66a4d5109e288bf6f2edd6b9f929bd051c0d8 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Wed, 11 Jul 2018 14:43:51 +0300 Subject: tree-view-drag-dest: Stop connecting to ::draw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "treeview-drop-indicator" style class was a thing in GTK2, but not in GTK3. So, remove this old code which isn't even do anything visible anymore. Also, the ::draw signal is going away when we move to GTK4. Rebased and ammended by António Fernandes --- src/nautilus-tree-view-drag-dest.c | 54 -------------------------------------- 1 file changed, 54 deletions(-) diff --git a/src/nautilus-tree-view-drag-dest.c b/src/nautilus-tree-view-drag-dest.c index 2a98181b4..939a89978 100644 --- a/src/nautilus-tree-view-drag-dest.c +++ b/src/nautilus-tree-view-drag-dest.c @@ -182,64 +182,12 @@ remove_expand_timer (NautilusTreeViewDragDest *dest) } } -static gboolean -highlight_draw (GtkWidget *widget, - cairo_t *cr, - gpointer data) -{ - GdkWindow *bin_window; - int width; - int height; - GtkStyleContext *style; - - /* FIXMEchpe: is bin window right here??? */ - bin_window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget)); - - width = gdk_window_get_width (bin_window); - height = gdk_window_get_height (bin_window); - - style = gtk_widget_get_style_context (widget); - - gtk_style_context_save (style); - gtk_style_context_add_class (style, "treeview-drop-indicator"); - - gtk_render_focus (style, - cr, - 0, 0, width, height); - - gtk_style_context_restore (style); - - return FALSE; -} - -static void -set_widget_highlight (NautilusTreeViewDragDest *dest, - gboolean highlight) -{ - if (!highlight) - { - g_clear_signal_handler (&dest->details->highlight_id, dest->details->tree_view); - gtk_widget_queue_draw (GTK_WIDGET (dest->details->tree_view)); - } - - if (highlight && !dest->details->highlight_id) - { - dest->details->highlight_id = - g_signal_connect_object (dest->details->tree_view, - "draw", - G_CALLBACK (highlight_draw), - dest, 0); - gtk_widget_queue_draw (GTK_WIDGET (dest->details->tree_view)); - } -} - static void set_drag_dest_row (NautilusTreeViewDragDest *dest, GtkTreePath *path) { if (path) { - set_widget_highlight (dest, FALSE); gtk_tree_view_set_drag_dest_row (dest->details->tree_view, path, @@ -247,7 +195,6 @@ set_drag_dest_row (NautilusTreeViewDragDest *dest, } else { - set_widget_highlight (dest, TRUE); gtk_tree_view_set_drag_dest_row (dest->details->tree_view, NULL, 0); @@ -258,7 +205,6 @@ static void clear_drag_dest_row (NautilusTreeViewDragDest *dest) { gtk_tree_view_set_drag_dest_row (dest->details->tree_view, NULL, 0); - set_widget_highlight (dest, FALSE); } static gboolean -- cgit v1.2.1