From 9b205a6ac743cfc416917aa3df74b0fcaf9359eb Mon Sep 17 00:00:00 2001 From: Alexander Schwinn <alexxcons@xfce.org> Date: Sun, 30 Apr 2023 10:47:27 +0200 Subject: [PATCH] Revert ce43203b to prevent high CPU usage in list-view (#1089) This reverts commit ce43203b29b8b2f7daa7b59cc6ffaefcd6e03db5. Fixes #1089 --- thunar/thunar-details-view.c | 19 +------------------ thunar/thunar-window.c | 6 +++--- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c index 3d64fc617..97ac90d65 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,10 +239,6 @@ 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); @@ -435,19 +431,6 @@ 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 e42735517..127c2fb37 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -2013,10 +2013,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 redraw te view if just some text is copied. + * in order to do not trigger if just some text is copied. */ - if (thunar_clipboard_manager_get_can_paste (window->clipboard) && G_LIKELY (window->view != NULL)) - gtk_widget_queue_draw (window->view); + if (thunar_clipboard_manager_get_can_paste (window->clipboard)) + thunar_window_reload (window, FALSE); } -- GitLab