Bug 473748

Summary: opening popup-palette quickly after selecting a layer, selects another layer which name starts with the letter of the popup-palette keyboard shortcut.
Product: [Applications] krita Reporter: fausto <nextecs>
Component: Layer StackAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73
Priority: NOR    
Version First Reported In: 5.1.5   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: krita usage and system log

Description fausto 2023-08-25 12:54:20 UTC
Created attachment 161173 [details]
krita usage and system log

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1.create a new file with 2 or more layers
2. add a single letter keyboard shortcut to the popup-palette 
3. name one layer starting with the letter you used as shorcut for the popup palette
4.select another layer that it's name does'nt start with the popup palette shortcut letter
5.quickly move the cursor to the canvas and open the popup palette using the keyboard shortcut 

OBSERVED RESULT
after opening the popup palette the layer which name starts with the same letter as the keyboard shortcut for the popup palette will be selected and you will drawing in this layer. the font of the layer name changes to bold but the highlight color of the layer stays on the last clicked layer, so visually looks like you are using the layer you clicked but it is not.

EXPECTED RESULT
after clicking/selecting any layer and opening the popup palette right after it should stay on the selectec/clicked layer

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: kubuntu 22.04.3 LTS
(available in About System)
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
I'm using the appimage version of krita

this is a screen capture of the bug in action https://youtu.be/T5joDge_gJ4
Comment 1 Dmitry Kazakov 2023-08-25 13:03:00 UTC
Hi, fausto!

That is a standard functionality of any OS: an ability to select an item in a list by typing its first letters. I'm not sure we should disable that functionality for the layers list.

In Krita we have a spacial workaround for such behavior, when you actively hover over the canvas for 400ms, Krita will automatically switch input focus to the canvas, so the layers list accelerators will not work anymore. You can also click on the canvas to explicitly set focus to it.

Basically, that applies to all single-letter shortcuts we have, like B, T, M and so on. 

Can you try that 400-ms delay approach? Will it work for you?
Comment 2 fausto 2023-08-25 13:30:31 UTC
(In reply to Dmitry Kazakov from comment #1)
> Hi, fausto!
> 
> That is a standard functionality of any OS: an ability to select an item in
> a list by typing its first letters. I'm not sure we should disable that
> functionality for the layers list.
> 
> In Krita we have a spacial workaround for such behavior, when you actively
> hover over the canvas for 400ms, Krita will automatically switch input focus
> to the canvas, so the layers list accelerators will not work anymore. You
> can also click on the canvas to explicitly set focus to it.
> 
> Basically, that applies to all single-letter shortcuts we have, like B, T, M
> and so on. 
> 
> Can you try that 400-ms delay approach? Will it work for you?

Hi, Dmitry. 

oh I see, I understand. this issue happened to me just because I was changing layers quickly so the 400ms approach will fix it for me. 
thank you very much for your time and help.
Comment 3 Bug Janitor Service 2023-08-26 03:45:21 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.