! 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 !
Thunar fails to select new files
Status:
RESOLVED: FIXED

Comments

Description Ambroz Bizjak 2011-02-22 01:13:27 CET
From the source code it appears that Thunar attempts to select new files after they are created (e.g. when copying files or creating an empty file). However it usually fails at that, because it attempts to select them before the view is refreshed, and fails to find them files in the cache.
Comment 1 Ambroz Bizjak 2011-02-22 01:15:28 CET
Created attachment 3498 
Fix for the bug

This patch makes Thunar start (or restart) a reload when new files are created, and attempt to select them only after the reload is done.
Comment 2 Ambroz Bizjak 2011-02-24 01:20:13 CET
Created attachment 3508 
ThunarJob: automatically reload ThunarFolder's of affected files, on the fly. Also simplify reporting new files.
Comment 3 Ambroz Bizjak 2011-02-24 01:21:19 CET
Created attachment 3509 
ThunarStandardView: make selecting new files work

Originally selecting new files didn't work (but was intended) because:
1) The folder was not reloaded before the new files handler looked up new files in the cache, so most of them were not yet in the cache.
   This problem is solved by the patch that makes jobs automatically reload folders.
2) When loading finished, pending new files were first selected, but then the old selection was restored.
   I've fixed the code not to restore old files if there are pending new files.

This patch also removes a now-superfluous reload of the folder.
Comment 4 Ambroz Bizjak 2011-02-24 01:21:48 CET
Created attachment 3510 
ThunarTreeView: make navigating to a newly created folder work

Originally navigating to a newly created folder didn't work (but was intended) because:
1) The parent folder of the new folder was not reloaded before the new files handler looked up the new folder in the cache.
   Like with ThunarStandardView, this if solved if jobs automatically reload folders.
2) The new files handler did not wait for a running reload of the parent folder to finish before attempting to lookup the new folder in the cache.
   This is solved by waiting for the parent folder to reload though its notify signal.
   (the current ThunarStandardView does that all right however)
Comment 5 Ambroz Bizjak 2011-06-17 15:33:43 CEST
Created attachment 3732 
fix ThunarFile race conditions

1. Fix a race condition where a ThunarFile reference count reaches zero, but thunar_file_cache_lookup() from another thread gets this invalid file from the cache, because thunar_file_finalize() hasn't removed it from the cache yet.

Fix by adding a toggle reference to the file serving as a cache reference of the file.

2. Fix a race condition in thunar_file_get() where thunar_file_cache_lookup() returns a valid file, but the file is finalized from another thread before thunar_file_get() takes a reference.

Fix it by making thunar_file_cache_lookup() take a reference of the file before unlocking the cache. Also update all code that uses thunar_file_cache_lookup().

These two bugs are encountered during a shift+del of a large folder (e.g. Linux kernel source) when my patch that makes running jobs reload ThunarFolders is applied.
Comment 6 Ambroz Bizjak 2011-06-17 15:34:22 CEST
Created attachment 3733 
ThunarJob: automatically reload ThunarFolder's of affected files, on the fly. Also simplify reporting new files.
Comment 7 Ambroz Bizjak 2011-06-17 15:34:58 CEST
Created attachment 3734 
ThunarStandardView: make selecting new files work
Comment 8 Ambroz Bizjak 2011-06-17 15:35:18 CEST
Created attachment 3735 
ThunarTreeView: make navigating to a newly created folder work
Comment 9 Ambroz Bizjak 2011-06-17 16:05:42 CEST
Created attachment 3736 
ThunarTreeView: make navigating to a newly created folder work

Oops, forgot some g_object_unref after thunar_file_get_cache
Comment 10 Nick Schermer editbugs 2012-10-28 20:11:52 CET
Fixed.
Comment 11 Nick Schermer editbugs 2012-10-28 20:12:01 CET
*** Bug 5877 has been marked as a duplicate of this bug. ***
Comment 12 Nick Schermer editbugs 2012-10-28 20:12:04 CET
*** Bug 5685 has been marked as a duplicate of this bug. ***
Comment 13 Nick Schermer editbugs 2012-11-04 20:06:31 CET
*** Bug 9453 has been marked as a duplicate of this bug. ***

Bug #7328

Reported by:
Ambroz Bizjak
Reported on: 2011-02-22
Last modified on: 2012-11-04
Duplicates (3):
  • 5685 Odd arrow key behavior after deleting a file/folder
  • 5877 wrong focused item when deleting an item in icon and compact view
  • 9453 Highlight newly created folder

People

Assignee:
Jannis Pohlmann
CC List:
4 users

Version

Attachments

Additional information