Bug 418655 - Mouse hover causes wrong preview of selected image
Summary: Mouse hover causes wrong preview of selected image
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: 5.69.0
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-09 09:58 UTC by medin
Modified: 2023-07-07 11:54 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
case-1.mp4 (348.24 KB, video/mp4)
2020-03-09 09:58 UTC, medin
Details
case-2.mp4 (314.86 KB, video/mp4)
2020-03-09 09:58 UTC, medin
Details
No thumbnail hover folder (641.06 KB, video/mp4)
2021-04-05 17:21 UTC, medin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description medin 2020-03-09 09:58:18 UTC
Created attachment 126688 [details]
case-1.mp4

I-First case:

1) Open Filechooser to location with some images
2) Select an image then move mouse pointer over another image
3) Move mouse pointer outside list of images

Expected behaviour :
Preview should show the selected image

Real behaviour :
Preview still shows the last image that mouse pointer passed on

See attached video case-1 for more info.


II-Second case:
1) Open Filechooser to location with some images
2) Select an image
3) Move mouse pointer over a folder then outside list of items

Expected behaviour :
Preview should show the selected image

Real behaviour :
Preview still shows nothing

See attached video case-2 for more info.

NB : In both cases, the preview panel reset to correct image only if mouse pointer move over an empty space at the end of list of items, but this is difficult if you have big list of items.
Comment 1 medin 2020-03-09 09:58:39 UTC
Created attachment 126690 [details]
case-2.mp4
Comment 2 medin 2020-10-17 17:29:35 UTC
Would not be logical to have preview of only the selected item and not the one which the mouse pointer pass over.
Comment 3 Méven Car 2020-10-24 06:32:45 UTC
(In reply to medin from comment #2)
> Would not be logical to have preview of only the selected item and not the
> one which the mouse pointer pass over.

No for consistency with other programs that have this behavior.

I guess the issue is that the focus-out event of the view is not cached by the preview panel, that should reset its preview file to the selected one by the the view.
Comment 4 Bug Janitor Service 2020-10-24 10:35:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/188
Comment 5 David Faure 2020-10-25 19:55:51 UTC
Git commit 0be10baef00c1fd3f26f6658b8c5ef6b56cbb862 by David Faure, on behalf of Méven Car.
Committed on 25/10/2020 at 19:55.
Pushed by dfaure into branch 'master'.

FileWidget: Show Selected file preview on mouse leave

For consistency with dolphin and show the preview of the file that will get
selected, upon activation.
FIXED-IN: 5.76

M  +18   -6    src/filewidgets/kdiroperator.cpp

https://invent.kde.org/frameworks/kio/commit/0be10baef00c1fd3f26f6658b8c5ef6b56cbb862
Comment 6 medin 2021-04-04 20:15:48 UTC
Second case is still happening.

Operating System: Manjaro Linux
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Kernel Version: 5.4.105-1-MANJARO
OS Type: 64-bit
Graphics Platform: X11
Comment 7 Nate Graham 2021-04-05 16:08:31 UTC
Works for me. Please attach a screen recording that shows it still happening so we can see what might be different about your setup.
Comment 8 medin 2021-04-05 17:20:24 UTC
(In reply to Nate Graham from comment #7)
> Works for me. Please attach a screen recording that shows it still happening
> so we can see what might be different about your setup.

In fact mouse pointer needs to exit list area two times with last item being hovered as folder. See attached video for more info.
Comment 9 medin 2021-04-05 17:21:15 UTC
Created attachment 137350 [details]
No thumbnail hover folder
Comment 10 Nate Graham 2021-04-05 20:29:53 UTC
Thanks for the video. I still cannot reproduce the issue when I set double-click and do the exact same thing. The moment my cursor passes over the table header, the preview image is restored as expected.
Comment 11 medin 2021-04-05 21:19:37 UTC
(In reply to Nate Graham from comment #10)
> Thanks for the video. I still cannot reproduce the issue when I set
> double-click and do the exact same thing. The moment my cursor passes over
> the table header, the preview image is restored as expected.

The problem comes from "General_Behavior>Animation_speed" being set to "Instant", If I set it in the middle the problem doesn't appear. I think the code that refresh the preview is inside a block that's not executed if "Animation speed" is set to "Instant".
Comment 12 Nate Graham 2021-04-05 21:31:16 UTC
Aha! Can reproduce with instant animations.

Wanna submit a merge request?
Comment 13 medin 2021-04-05 21:46:23 UTC
(In reply to Nate Graham from comment #12)
> Aha! Can reproduce with instant animations.
> 
> Wanna submit a merge request?

I wish I had the skills to do it :(
Comment 14 medin 2023-07-06 09:46:19 UTC
On Wayland the problem is still present both in case 1 and 2 even if animations are enabled.
Comment 15 medin 2023-07-06 09:50:20 UTC
(In reply to Méven Car from comment #3)

> No for consistency with other programs that have this behavior.

I don't know of any KDE app that has this weird behavior, it will be great to enabled preview only if the item is effectively select like how GTK dialogs do it.
Comment 16 Méven Car 2023-07-07 07:15:37 UTC
(In reply to medin from comment #15)
> (In reply to Méven Car from comment #3)
> 
> > No for consistency with other programs that have this behavior.
> 
> I don't know of any KDE app that has this weird behavior,

I meant Dolphin has this behavior, but nowadays its information panel has a setting to switch to "preview only selected files" mode.

This behavior is mostly tailored for single click mode and it is important for that use case we want to support.
Comment 17 medin 2023-07-07 09:41:35 UTC
(In reply to Méven Car from comment #16)
> (In reply to medin from comment #15)
> > (In reply to Méven Car from comment #3)
> > 
> > > No for consistency with other programs that have this behavior.
> > 
> > I don't know of any KDE app that has this weird behavior,
> 
> I meant Dolphin has this behavior, but nowadays its information panel has a
> setting to switch to "preview only selected files" mode.

That information panel also suffers from this bug. Where can I find "preview only selected files" mode to enable/disable it inside Dolphin?

> This behavior is mostly tailored for single click mode and it is important
> for that use case we want to support.

Double click is the default choice on other platforms, because it avoids accidental opens and is not confusing.
Comment 18 medin 2023-07-07 11:54:55 UTC
The real frustration is when you select an important file to submit online, and you always find yourself with the selected file different from the one visible on preview panel, so I always recheck the preview by re-selecting the target file, it's daily frustration for me when it concerns file selector which is one of the important software products in Plasma desktop.