Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
thunar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
279
Issues
279
List
Boards
Labels
Service Desk
Milestones
Custom Issue Tracker
Custom Issue Tracker
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xfce
thunar
Commits
13a09f1e
Commit
13a09f1e
authored
Mar 23, 2020
by
Theo Linkspfeifer
Committed by
Alexander Schwinn
Mar 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use tre-view toplevel path of the cursor, if available, in order to
prevent jumping (Bug #16024)
parent
6850f6fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
thunar/thunar-tree-view.c
thunar/thunar-tree-view.c
+31
-2
No files found.
thunar/thunar-tree-view.c
View file @
13a09f1e
...
...
@@ -2866,8 +2866,8 @@ thunar_tree_view_set_show_hidden (ThunarTreeView *view,
*
* Searches for the best-matching toplevel path in the
* following order:
* 1)
any mounted device or network resourc
e
* 2)
the user's desktop directory
* 1)
the currently active on
e
* 2)
any mounted device or network resource
* 3) the user's home directory
* 4) the root filesystem
*
...
...
@@ -2893,6 +2893,35 @@ thunar_tree_view_get_preferred_toplevel_path (ThunarTreeView *view,
if
(
!
gtk_tree_model_get_iter_first
(
model
,
&
iter
))
return
NULL
;
/* get active toplevel path and check if we can use it */
gtk_tree_view_get_cursor
(
GTK_TREE_VIEW
(
view
),
&
path
,
NULL
);
if
(
path
!=
NULL
)
{
if
(
gtk_tree_path_get_depth
(
path
)
!=
1
)
while
(
gtk_tree_path_get_depth
(
path
)
>
1
)
gtk_tree_path_up
(
path
);
if
(
gtk_tree_model_get_iter
(
GTK_TREE_MODEL
(
view
->
model
),
&
iter
,
path
))
{
/* lookup file for the toplevel item */
gtk_tree_model_get
(
GTK_TREE_MODEL
(
view
->
model
),
&
iter
,
THUNAR_TREE_MODEL_COLUMN_FILE
,
&
toplevel_file
,
-
1
);
if
(
toplevel_file
)
{
/* check if the toplevel file is an ancestor */
if
(
thunar_file_is_ancestor
(
file
,
toplevel_file
))
{
g_object_unref
(
toplevel_file
);
return
path
;
}
g_object_unref
(
toplevel_file
);
}
}
gtk_tree_path_free
(
path
);
path
=
NULL
;
}
/* get GFiles for special toplevel items */
desktop
=
thunar_g_file_new_for_desktop
();
home
=
thunar_g_file_new_for_home
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment