! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Weird history behaviour when opening directory in new tab
Status:
RESOLVED: MOVED

Comments

Description Michael 2016-01-08 17:28:19 CET
When opening a directory in a new tab, the history of the previous tab is copied into the new one, but the newly opened directory is not stored in the history.

For example:
* Navigate to root ('File System')
* Navigate to the 'usr' directory
* Navigate to the 'share' directory

The top two entries should now say 'usr' and 'File System'.

* Right click the xfce4 directory and click on 'Open in New Tab'

Note that this new tab has the same history as the old one.

* Navigate to the 'applications' directory

Note that the 'share' directory has now been added to the history, but the 'xfce4' directory has not.  When you use the back button at this point, you will indeed end up in /usr/share and not in /usr/share/xfce4.

This odd behaviour does not occur when opening a directory in a new *window*.


Expected behaviour:
* Opening a directory in a new tab should give the new tab a fresh history, as in web browsers with tabs.
* The directory that is opened in the new tab should be recorded in the history of that new tab.


Version info:
I am using version 1.6.10-2 on amd64, as provided by packages of Debian Stretch.
Comment 1 Daniel Reichelt 2017-07-29 22:20:46 CEST
Another problem, related to this is:

When you follow Michael's steps and, from the 'xfce4' tab, navigate one level
up, the 'xfce4' folder *should* be selected, but it isn't. Also, this is not a
problem when 'xfce4' was opened as a new window.

git-bisect'ing identified

https://git.xfce.org/xfce/thunar/commit/?id=aa5f8fca0e6e965a9592da30c36d2fa4afe44746

as the culprit.


Digging into this revealed actually two problems here:



1) thunar_window_notebook_insert(ThunarWindow *window, ThunarFile *directory)
creates a copy of the history for the new tab to use. For newly created tabs,
these histories are exact copies, lacking a history entry for the directoy of
the original tab itself (this is what Michael already explained).


So the obvious solution would be to just add

thunar_navigator_set_current_directory(THUNAR_NAVIGATOR(history), directory);

after the copied history has been set on the new tab.


HOWEVER:


2) Things get really interesting, when you open multiple new tabs at once, say,
not only 'xfce' but also 'xml' and 'zoneinfo':

Within thunar_window_notebook_insert(...), the call

history = thunar_standard_view_copy_history (THUNAR_STANDARD_VIEW (window->view));

does not copy the history from the "originating tab", but from the most recently active tab.
Since tabs get "activated" from within thunar_window_notebook_insert(), in effect the history

- for the 'xfce' tab initially is a copy of the "original" tab's,

- for 'xml' it's a copy of the 'xfce' tab's,

- for 'zoneinfo' it's a copy of the 'xml' tab's and so on



Due to this, the fix above causes every later opened tab to have a history entry for its predecessor.

I'm not sure how to fix that one...


Cheers
Daniel
Comment 2 Git Bot editbugs 2020-05-26 23:25:36 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar/-/issues/128.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #12403

Reported by:
Michael
Reported on: 2016-01-08
Last modified on: 2020-05-26

People

Assignee:
Xfce Bug Triage
CC List:
6 users

Version

Version:
1.6.10

Attachments

Additional information