From ce43203b29b8b2f7daa7b59cc6ffaefcd6e03db5 Mon Sep 17 00:00:00 2001 From: Alexander Schwinn <alexxcons@xfce.org> Date: Sat, 25 Mar 2023 23:31:28 +0100 Subject: [PATCH] Dont reload the current folder on copy/cut (#1060) Instead, only redraw the current view (cherry picked from commit 9c2299764dd94ff3cfed9ae6f7a152789ea55510) --- thunar/thunar-details-view.c | 19 ++++++++++++++++++- thunar/thunar-window.c | 6 +++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c index 97ac90d65..3d64fc617 100644 --- a/thunar/thunar-details-view.c +++ b/thunar/thunar-details-view.c @@ -113,7 +113,7 @@ static void thunar_details_view_append_menu_items (ThunarStandardV GtkMenu *menu, GtkAccelGroup *accel_group); static void thunar_details_view_highlight_option_changed(ThunarDetailsView *details_view); - +static void thunar_details_view_draw (ThunarDetailsView *details_view); struct _ThunarDetailsViewClass @@ -239,6 +239,10 @@ thunar_details_view_init (ThunarDetailsView *details_view) gtk_container_add (GTK_CONTAINER (details_view), tree_view); gtk_widget_show (tree_view); + /* forwards the 'draw' signal down to the tree-view */ + g_signal_connect_after (G_OBJECT (details_view), "draw", + G_CALLBACK (thunar_details_view_draw), details_view); + /* configure general aspects of the details view */ gtk_tree_view_set_enable_search (GTK_TREE_VIEW (tree_view), TRUE); @@ -431,6 +435,19 @@ thunar_details_view_finalize (GObject *object) +static void +thunar_details_view_draw (ThunarDetailsView *details_view) +{ + GList *children; + + /* redraw as well the corresponding exo_tree_view, which is the only child */ + children = gtk_container_get_children (GTK_CONTAINER (details_view)); + for (GList *lp = children; lp != NULL; lp = lp->next) + gtk_widget_queue_draw (lp->data); +} + + + static AtkObject* thunar_details_view_get_accessible (GtkWidget *widget) { diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 501a502a5..f9d4770e7 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -2000,10 +2000,10 @@ thunar_window_clipboard_manager_changed (GtkWidget *widget) ThunarWindow *window = THUNAR_WINDOW (widget); /* check if the content actually can be pasted into thunar, - * in order to do not trigger if just some text is copied. + * in order to do not redraw te view if just some text is copied. */ - if (thunar_clipboard_manager_get_can_paste (window->clipboard)) - thunar_window_reload (window, FALSE); + if (thunar_clipboard_manager_get_can_paste (window->clipboard) && G_LIKELY (window->view != NULL)) + gtk_widget_queue_draw (window->view); } -- GitLab