diff --git a/Thunar.spec b/Thunar.spec index 1f9afe8..c9ef3fc 100644 --- a/Thunar.spec +++ b/Thunar.spec @@ -4,7 +4,7 @@ Name: Thunar Version: 1.8.4 -Release: 3%{?dist} +Release: 5%{?dist} Summary: Thunar File Manager License: GPLv2+ @@ -16,6 +16,12 @@ Source2: thunar-sendto-audacious-playlist.desktop Source3: thunar-sendto-quodlibet-playlist.desktop Source4: thunar-sendto-blueman.desktop +# https://bugzilla.redhat.com/show_bug.cgi?id=1701829 +# https://bugzilla.xfce.org/show_bug.cgi?id=15174 +Patch0: fix_tree_view_scroll.patch +# newer patch from #15174 +Patch1: fix_tree_view_scroll_2.patch + BuildRequires: gcc-c++ BuildRequires: pkgconfig(dbus-glib-1) >= 0.34 BuildRequires: pkgconfig(exo-1) >= 0.12.0 @@ -71,7 +77,7 @@ Requires: %{name} = %{version}-%{release} Thunarx GTK documentation files for the Thunar file manager. %prep -%autosetup +%autosetup -p1 # fix icon in thunar-sendto-email.desktop sed -i 's!internet-mail!mail-message-new!' \ @@ -189,6 +195,12 @@ done %{_datadir}/gtk-doc/html/thunarx/* %changelog +* Wed Apr 24 2019 Mukundan Ragavan - 1.8.4-5 +- Add newer patch to fix tree view behavior + +* Mon Apr 22 2019 Mukundan Ragavan - 1.8.4-4 +- Add patch to fix tree view weirdness + * Sat Apr 13 2019 Kevin Fenzi - 1.8.4-3 - Add gobject introspection files. Fixes bug #1698267 diff --git a/fix_tree_view_scroll.patch b/fix_tree_view_scroll.patch new file mode 100644 index 0000000..62ad5e2 --- /dev/null +++ b/fix_tree_view_scroll.patch @@ -0,0 +1,56 @@ +From 0735e5bb8dd3b8fbac13f1b4165e30e27cea643f Mon Sep 17 00:00:00 2001 +From: Alexander Schwinn +Date: Mon, 18 Mar 2019 23:02:01 +0100 +Subject: tree view jumps (scrolls) when clicking on a directory (Bug #15174) + +--- + thunar/thunar-tree-view.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c +index 3ac367e4..ed3410f6 100644 +--- a/thunar/thunar-tree-view.c ++++ b/thunar/thunar-tree-view.c +@@ -2533,6 +2533,7 @@ THUNAR_THREADS_ENTER + + gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path); + gtk_tree_path_free (path); ++ path = NULL; + + /* collect all ThunarFiles in the path of current_directory in a List. root is on the very left side */ + for (file = view->current_directory; file != NULL; file = thunar_file_get_parent (file, NULL)) +@@ -2581,11 +2582,11 @@ THUNAR_THREADS_ENTER + gtk_tree_model_get (GTK_TREE_MODEL (view->model), &child_iter, THUNAR_TREE_MODEL_COLUMN_FILE, &file_in_tree, -1); + if (file == file_in_tree) + { ++ if (path != NULL) ++ gtk_tree_path_free (path); + g_object_unref (file_in_tree); ++ /* always remember latest known path, so we can set the cursor to it */ + path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->model), &child_iter); +- gtk_tree_view_expand_to_path (GTK_TREE_VIEW (view), path); +- gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE); +- gtk_tree_path_free (path); + iter = child_iter; /* next tree level */ + break; + } +@@ -2597,6 +2598,16 @@ THUNAR_THREADS_ENTER + } + } + ++ if (path == NULL) ++ path = thunar_tree_view_get_preferred_toplevel_path (view, view->current_directory); ++ ++ if (path != NULL) ++ { ++ gtk_tree_view_expand_to_path (GTK_TREE_VIEW (view), path); ++ gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE); ++ gtk_tree_path_free (path); ++ } ++ + /* tidy up */ + for (lp = path_as_list; lp != NULL; lp = lp->next) + { +-- +cgit v1.2.1 + diff --git a/fix_tree_view_scroll_2.patch b/fix_tree_view_scroll_2.patch new file mode 100644 index 0000000..a6d2242 --- /dev/null +++ b/fix_tree_view_scroll_2.patch @@ -0,0 +1,155 @@ +From c8154a3d7e556404be38a578a90c34a4aeb15c7c Mon Sep 17 00:00:00 2001 +From: Alexander Schwinn +Date: Wed, 24 Apr 2019 21:34:43 +0200 +Subject: [PATCH] tree view jumps (scrolls) when clicking on a directory II + (Bug #15174) + +--- + thunar/thunar-tree-view.c | 88 ++++++++++++++++++++++++++--------------------- + 1 file changed, 49 insertions(+), 39 deletions(-) + +diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c +index 84eecbe3..43d3627f 100644 +--- a/thunar/thunar-tree-view.c ++++ b/thunar/thunar-tree-view.c +@@ -2499,11 +2499,10 @@ thunar_tree_view_cursor_idle (gpointer user_data) + GtkTreePath *path; + GtkTreeIter iter; + ThunarFile *file; +- ThunarFile *parent; +- GFileInfo *parent_info; ++ GFileInfo *file_info; + GtkTreeIter child_iter; + ThunarFile *file_in_tree; +- gboolean done = TRUE; ++ gboolean done = FALSE; + GList *lp; + GList *path_as_list = NULL; + +@@ -2515,12 +2514,12 @@ THUNAR_THREADS_ENTER + gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), view->select_path, NULL, FALSE); + gtk_tree_path_free (view->select_path); + view->select_path = NULL; +- return done; ++ return TRUE; + } + + /* verify that we still have a current directory */ + if (G_UNLIKELY (view->current_directory == NULL)) +- return done; ++ return TRUE; + + /* get the preferred toplevel path for the current directory */ + path = thunar_tree_view_get_preferred_toplevel_path (view, view->current_directory); +@@ -2537,63 +2536,74 @@ THUNAR_THREADS_ENTER + for (file = view->current_directory; file != NULL; file = thunar_file_get_parent (file, NULL)) + path_as_list = g_list_prepend (path_as_list, file); + +- /* note that iter may start at e.g. $HOME where "path_as_list" usually starts at "/" */ +- /* So the first few iterations most times will do nothing */ ++ /* 1. skip files on path_as_list till we found the beginning of the tree (which e.g. may start at $HOME */ ++ gtk_tree_model_get (GTK_TREE_MODEL (view->model), &iter, THUNAR_TREE_MODEL_COLUMN_FILE, &file_in_tree, -1); + for (lp = path_as_list; lp != NULL; lp = lp->next) + { ++ if (THUNAR_FILE (lp->data) == file_in_tree) ++ break; ++ } ++ if (file_in_tree) ++ g_object_unref (file_in_tree); ++ ++ /* 2. loop on the remaining path_as_list */ ++ for (; lp != NULL; lp = lp->next) ++ { + file = THUNAR_FILE (lp->data); + +- /* check if iter has only a dummy node (tree not fully loaded yet) */ ++ /* 3 check if iter has only a dummy node (tree not fully loaded yet) */ + if( thunar_tree_model_node_has_dummy (view->model, iter.user_data) ) ++ break; ++ ++ /* 4. Loop on all items of current tree-level to see if any folder matches the path we search */ ++ while (TRUE) ++ { ++ gtk_tree_model_get (GTK_TREE_MODEL (view->model), &iter, THUNAR_TREE_MODEL_COLUMN_FILE, &file_in_tree, -1); ++ if (file == file_in_tree) ++ { ++ if (path != NULL) ++ gtk_tree_path_free (path); ++ g_object_unref (file_in_tree); ++ /* always remember latest known path, so we can set the cursor to it */ ++ path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->model), &iter); ++ break; ++ } ++ if (file_in_tree) ++ g_object_unref (file_in_tree); ++ ++ if (!gtk_tree_model_iter_next (GTK_TREE_MODEL (view->model), &iter)) ++ break; ++ } ++ ++ /* 5. Did we already find the full path ?*/ ++ if (lp->next == NULL) + { +- done = FALSE; ++ done = TRUE; + break; + } + +- /* Try to create missing children if there are none (this as well initializes child_iter if there are children) */ ++ /* 6. Get all children of the current tree iter */ ++ /* Try to create missing children on the tree if there are none */ + if (!gtk_tree_model_iter_children (GTK_TREE_MODEL (view->model), &child_iter, &iter)) + { +- done = FALSE; +- parent = thunar_file_get_parent (file, NULL); +- if (parent == NULL) /* e.g root has no parent .. skip it */ ++ if (file == NULL) /* e.g root has no parent .. skip it */ + continue; + +- parent_info = thunar_file_get_info (parent); +- if (parent_info != NULL) ++ file_info = thunar_file_get_info (file); ++ if (file_info != NULL) + { + /* E.g. folders for which we do not have read permission dont have any child in the tree */ + /* Make sure that missing read permissions are the problem */ +- if (!g_file_info_get_attribute_boolean (parent_info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ)) ++ if (!g_file_info_get_attribute_boolean (file_info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ)) + { + /* We KNOW that there is a File. Lets just create the required tree-node */ +- thunar_tree_model_add_child (view->model, iter.user_data, file); ++ thunar_tree_model_add_child (view->model, iter.user_data, THUNAR_FILE (lp->next->data)); + } + } +- g_object_unref (parent); + break; /* we dont have a valid child_iter by now, so we cannot continue. */ + /* Since done is FALSE, the next iteration on thunar_tree_view_cursor_idle will go deeper */ + } +- +- /* loop on children to see if any folder matches */ +- while (TRUE) +- { +- gtk_tree_model_get (GTK_TREE_MODEL (view->model), &child_iter, THUNAR_TREE_MODEL_COLUMN_FILE, &file_in_tree, -1); +- if (file == file_in_tree) +- { +- if (path != NULL) +- gtk_tree_path_free (path); +- g_object_unref (file_in_tree); +- /* always remember latest known path, so we can set the cursor to it */ +- path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->model), &child_iter); +- iter = child_iter; /* next tree level */ +- break; +- } +- if (file_in_tree) +- g_object_unref (file_in_tree); +- +- if (!gtk_tree_model_iter_next (GTK_TREE_MODEL (view->model), &child_iter)) +- break; +- } ++ iter = child_iter; /* next tree level */ + } + + if (path == NULL) +-- +2.11.0 +