Bug 388555

Summary: renamed file reclaims focus
Product: [Applications] dolphin Reporter: Michael Heidelbach <ottwolt>
Component: generalAssignee: andreas.krutzler
Status: RESOLVED FIXED    
Severity: normal CC: aria, elvis.angelaccio, nate, ottwolt, sonichedgehog_hyperblast00
Priority: NOR Keywords: usability
Version: 17.12.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 18.03.80

Description Michael Heidelbach 2018-01-05 10:38:38 UTC
After renaming a file and then selecting another file the just renamed file gets selected again after about half a second.

Steps to reproduce:
$ md /tmp/otto
$ cd /tmp/otto
$ touch a.tmp b.tmp
$ dolphin /tmp/otto

In dolphin:
select a.tmp
<F2>
type aaa
select b.tmp

Actual Result:
a.tmp renamed to aaa.tmp
After a short delay aaa.tmp is selected and b.tmp is unselected

Expected result:
a.tmp renamed to aaa.tmp
b.tmp stays selected, aaa.tmp stays unselected

I cannot remember exactly when this bug was introduced but surely after v16.12

Happens in all view modes.
Comment 1 Nate Graham 2018-01-05 15:20:22 UTC
Can reproduce. This happens if you select another file *immediately* after renaming; it seems that there's some timer that waits a moment before forcing selection on the newly-renamed file, and fast users can beat it and get their desired new selection reset to the old renamed file.

Could be related to the recent fixes for Bug 205157 or Bug 378786. Andreas, would you mind having a look?
Comment 2 Michael Heidelbach 2018-01-05 17:58:39 UTC
If you hit <F2> fast enough you can even rename b.tmp *and* have aaa.tmp selected.
After that focus stays at aaa.tmp
Comment 3 Nate Graham 2018-01-06 01:55:11 UTC
(And if you want to dig into this yourself and figure it out, Michael, please feel free to submit a patch!)
Comment 4 andreas.krutzler 2018-01-06 14:07:19 UTC
As far as I can tell this is not related to the fixes of Bug 205157 or Bug 378786. But it could be related to https://phabricator.kde.org/D6312.

Lets see if I can fix that in the next few days :)
Comment 5 Nate Graham 2018-01-14 05:23:43 UTC
*** Bug 388888 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2018-01-14 05:24:38 UTC
Thanks to Andreas, we have a potential patch that fixes the issue: https://phabricator.kde.org/D9711
Comment 7 Nate Graham 2018-01-21 20:43:46 UTC
Git commit bba44ae907b4faaf115d33fb0a3c50cd96ee2cb6 by Nathaniel Graham, on behalf of Andreas Krutzler.
Committed on 21/01/2018 at 20:43.
Pushed by ngraham into branch 'master'.

Fix renamed file reclaims focus

Summary:
After renaming a file and then selecting another file immediately the just selected file stays selected.

Test Plan:
Steps to reproduce:
$ mkdir /tmp/test
$ cd /tmp/test
$ touch a.tmp b.tmp
$ dolphin /tmp/test

In dolphin:
* select a.tmp
* <F2>
* type aaa
* select b.tmp immediately

Expected result:
* a.tmp renamed to aaa.tmp
* b.tmp stays selected, aaa.tmp stays unselected

Reviewers: ngraham, michaelh, #dolphin, elvisangelaccio

Reviewed By: ngraham, michaelh, #dolphin, elvisangelaccio

Subscribers: emateli, elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D9711

M  +33   -26   src/views/dolphinview.cpp

https://commits.kde.org/dolphin/bba44ae907b4faaf115d33fb0a3c50cd96ee2cb6
Comment 8 Elvis Angelaccio 2018-02-03 15:51:07 UTC
*** Bug 389809 has been marked as a duplicate of this bug. ***
Comment 9 Mircea Kitsune 2018-02-03 20:12:46 UTC
This has been a huge annoyance to me as well for quite some time. Thank you for fixing it!