Bug 391088

Summary: Pan tool shortcut inactive a few moments after docker widget interaction.
Product: [Applications] krita Reporter: stefano <stefano_urru>
Component: Tools/MoveAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: emmetoneill.pdx, ghevan, halla, jtamate, nickelbacher, samuel.lostiousness
Priority: NOR Keywords: investigated, triaged
Version: 4.0.0-beta.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description stefano 2018-02-26 09:12:15 UTC
At any selection of layers the move tool become unactive for one "action".

Workflow to test the bug: 
Start a new file in krita
Create a new layer
Just after creation : 
         Move your canvas pressing spacebar and then left mouse button (it works)
Click with the mouse on a different layer to select it 
         Pressing spacebar (1°) nothing happens, you cant move the canvas
         Pressing spacebar (2°) this time it works and you can move canvas  
NOTE: 
If you use a shortcut to change the selected layer, the bug will not happens
Comment 1 Halla Rempt 2018-02-27 09:46:04 UTC
Hi Stefano, 

I'm afraid I cannot reproduce the issue :-(
Comment 2 nickelbacher 2018-04-07 05:29:09 UTC
I can confirm this is an issue. I think it's related to input focus on the layer panel. The space bar does not register the first press after selecting a new layer. Pretty annoying too, since I have to double tap space each time I select a layer from the layer panel.

Space has to be the first thing you press after selecting a layer if you want to reproduce.


I'm using Windows if that helps.
Comment 3 Emmet O'Neill 2018-09-15 22:18:22 UTC
Stopping by for KDE bug squad, I also can't reproduce this on Linux compiled master (git 12b52e3). 

Could be a Windows-specific bug, needs Windows testing.
Comment 4 Jaime Torres 2018-09-24 10:28:27 UTC
Confirmed on windows nighly build.
  Version: 4.2.0-pre-alpha (git 0bddab7)
Qt
  Version (compiled): 5.11.1
  Version (loaded): 5.11.1

After selecting a layer, pressing space the first time to move the canvas and moving the mouse with the left button pressed only applies the current brush. 
The second time it moves the canvas.
Comment 5 Halla Rempt 2019-05-09 14:48:18 UTC
It's a focus issue, and don't think we can fix this. The canvas widget needs to be selected for key presses to arrive, there isn't something like hover focus in Qt where the canvas would get key presses if the cursor is over it. Besides, it often enough happens that people want to change e.g. layer names while their cursor is still over the canvas.
Comment 6 vanyossi 2020-01-30 21:38:10 UTC
*** Bug 416849 has been marked as a duplicate of this bug. ***
Comment 7 nickelbacher 2020-02-01 21:23:40 UTC
The solution would be to make the panel widget pass-through unused key presses to the canvas unless you are inputting text (e.g. renaming a layer). 
Or have the panel itself handle these common key presses in a way that users would expect (activating pan tool, etc).
Comment 8 Halla Rempt 2020-04-10 12:35:26 UTC

*** This bug has been marked as a duplicate of bug 372646 ***
Comment 9 Dmitry Kazakov 2020-04-15 20:52:51 UTC
Git commit d454a04e713c0ffc4167021680f69be3698871ec by Dmitry Kazakov.
Committed on 15/04/2020 at 20:46.
Pushed by dkazakov into branch 'krita/4.3'.

Fix pan/zoom shortcuts not working after accessing any docker

The reason for the bug was that KisExtendedModifiersMapper::
queryExtendedModifiers() has never been implemented for Windows.
Therefore all the shortcuts including Space could potentially be
lost when the user pressed it without focusing on the canvas.

We also need an implementation for OSX.
Related: bug 372646, bug 373299

M  +53   -3    libs/ui/input/kis_extended_modifiers_mapper.cpp

https://invent.kde.org/kde/krita/commit/d454a04e713c0ffc4167021680f69be3698871ec
Comment 10 Dmitry Kazakov 2020-04-15 20:53:01 UTC
Git commit f49dac3a603d8d40108523be436be1b251966ac5 by Dmitry Kazakov.
Committed on 15/04/2020 at 20:48.
Pushed by dkazakov into branch 'master'.

Fix pan/zoom shortcuts not working after accessing any docker

The reason for the bug was that KisExtendedModifiersMapper::
queryExtendedModifiers() has never been implemented for Windows.
Therefore all the shortcuts including Space could potentially be
lost when the user pressed it without focusing on the canvas.

We also need an implementation for OSX.
Related: bug 372646, bug 373299

M  +53   -3    libs/ui/input/kis_extended_modifiers_mapper.cpp

https://invent.kde.org/kde/krita/commit/f49dac3a603d8d40108523be436be1b251966ac5
Comment 11 vanyossi 2020-05-19 06:04:50 UTC
Git commit 4b9fa0c85e8f4cf9412ad01dd073c4a83ac7ea67 by Ivan Yossi.
Committed on 19/05/2020 at 06:04.
Pushed by ivany into branch 'master'.

fix extenderModifiers for OSX

Keys other than modifiers cannot be accessed outside
of non key related events from NSApplication. adding
a local monitor allows to catch the keys we need
during the delay duration.

Try to handle all modifiers from localMonitor

Apply modifiers already pressed on focusIn events macos

We now request a copy of keydown and modifier change
events to set the proper flags as background application
Related: bug 372646, bug 373299

M  +1    -0    libs/ui/CMakeLists.txt
M  +18   -0    libs/ui/input/kis_extended_modifiers_mapper.cpp
M  +5    -0    libs/ui/input/kis_extended_modifiers_mapper.h
C  +14   -26   libs/ui/input/kis_extended_modifiers_mapper_osx.h [from: libs/ui/input/kis_extended_modifiers_mapper.h - 051% similarity]
A  +134  -0    libs/ui/input/kis_extended_modifiers_mapper_osx.mm
M  +6    -0    libs/ui/input/kis_input_manager.cpp
M  +12   -0    libs/ui/input/kis_input_manager_p.cpp

https://invent.kde.org/graphics/krita/commit/4b9fa0c85e8f4cf9412ad01dd073c4a83ac7ea67
Comment 12 Halla Rempt 2020-05-19 09:08:59 UTC
Git commit 483d38ba26d4008a74c16f5f96c525ff997b618c by Boudewijn Rempt, on behalf of Ivan Yossi.
Committed on 19/05/2020 at 09:08.
Pushed by rempt into branch 'krita/4.3'.

fix extenderModifiers for OSX

Keys other than modifiers cannot be accessed outside
of non key related events from NSApplication. adding
a local monitor allows to catch the keys we need
during the delay duration.

Try to handle all modifiers from localMonitor

Apply modifiers already pressed on focusIn events macos

We now request a copy of keydown and modifier change
events to set the proper flags as background application
Related: bug 372646, bug 373299
(cherry picked from commit 4b9fa0c85e8f4cf9412ad01dd073c4a83ac7ea67)

M  +1    -0    libs/ui/CMakeLists.txt
M  +18   -0    libs/ui/input/kis_extended_modifiers_mapper.cpp
M  +5    -0    libs/ui/input/kis_extended_modifiers_mapper.h
C  +14   -26   libs/ui/input/kis_extended_modifiers_mapper_osx.h [from: libs/ui/input/kis_extended_modifiers_mapper.h - 051% similarity]
A  +134  -0    libs/ui/input/kis_extended_modifiers_mapper_osx.mm
M  +6    -0    libs/ui/input/kis_input_manager.cpp
M  +12   -0    libs/ui/input/kis_input_manager_p.cpp

https://invent.kde.org/graphics/krita/commit/483d38ba26d4008a74c16f5f96c525ff997b618c