[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-07-13 Thread Dmitry Kazakov
https://bugs.kde.org/show_bug.cgi?id=409613

Dmitry Kazakov  changed:

   What|Removed |Added

  Latest Commit|https://invent.kde.org/grap |https://invent.kde.org/grap
   |hics/krita/commit/80bdcbdf2 |hics/krita/commit/adc8c597d
   |2a009c06523d535de9e2dd682ff |c2b10b02ec377e258e677361a0e
   |db34|bec3

--- Comment #15 from Dmitry Kazakov  ---
Git commit adc8c597dc2b10b02ec377e258e677361a0ebec3 by Dmitry Kazakov.
Committed on 13/07/2020 at 12:57.
Pushed by dkazakov into branch 'master'.

Fix broken shortcuts when user uses Space key as a modifier

The Problem
---

Qt cannot use Space (or any non-modifier) key as a modifier. When
we assign "Space+R" shortcut to "Reset rotation" in Krita settings,
Qt actually assigns it not to "Space+R", but to "Space, R". That is,
the user is expected to press the two keys sequentially, not
simultaneously (though the latter option also works).

It means that after the user presses "Space" key, Qt transits into a
special state of an incomplete match and starts waiting for the following
key. While in this state, Qt (without this patch) eats all the shortcut
events.

Solution


There is no proper solution for the problem, because Qt will still wait
for the second key to be pressed. That is, there is no way to instruct
Qt that Space and R keys should be pressed simultaneously (it is not
possible by design of QKeySequence.

This patch adds a workaround for the problem. It makes sure that all the
shortcut events are delivered to Krita, whatever the state Qt has
internally.

Test Plan
-

Configuration:

1) Assign W as a primary shortcut for Zoom-In in **Canvas Input Settings**
2) Assign Space,R as a primary shortcut for Zoom-Out in **Keyboard Shortcuts**
3) Assign Space,W as a primary shortcut Rotate Canvas Left in **Keyboard
Shortcuts**

Testcase 1:

1) Press Space, Release Space
2) Press W, Release W

Expected: canvas is zoomed in and not rotated, space+drag gesture still works
fine

Testcase 2:

1) Press Space, Release Space
2) Press W, Release W
2) Press R, Release R

Expected: no zoom-out action happens (because Space modifier has already been
consumed by the former action)

Testcase 3:

1) Press Space, Release Space
2) Press R, Release R

Expected: zoom-out action happens, space+drag gesture still works fine


Testcase 4:

Press Space, W and R randomly, it should still behave "in a sane way" :)

A  +68   -0   
3rdparty/ext_qt/0101-Don-t-eat-ShortcutOverride-events-when-there-is-a-pa.patch
M  +4-03rdparty/ext_qt/CMakeLists.txt
M  +6-8libs/ui/input/kis_input_manager.cpp

https://invent.kde.org/graphics/krita/commit/adc8c597dc2b10b02ec377e258e677361a0ebec3

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-07-13 Thread Dmitry Kazakov
https://bugs.kde.org/show_bug.cgi?id=409613

Dmitry Kazakov  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Latest Commit||https://invent.kde.org/grap
   ||hics/krita/commit/80bdcbdf2
   ||2a009c06523d535de9e2dd682ff
   ||db34
 Resolution|--- |FIXED

--- Comment #14 from Dmitry Kazakov  ---
Git commit 80bdcbdf22a009c06523d535de9e2dd682ffdb34 by Dmitry Kazakov.
Committed on 13/07/2020 at 09:17.
Pushed by dkazakov into branch 'krita/4.3'.

Fix broken shortcuts when user uses Space key as a modifier

The Problem
---

Qt cannot use Space (or any non-modifier) key as a modifier. When
we assign "Space+R" shortcut to "Reset rotation" in Krita settings,
Qt actually assigns it not to "Space+R", but to "Space, R". That is,
the user is expected to press the two keys sequentially, not
simultaneously (though the latter option also works).

It means that after the user presses "Space" key, Qt transits into a
special state of an incomplete match and starts waiting for the following
key. While in this state, Qt (without this patch) eats all the shortcut
events.

Solution


There is no proper solution for the problem, because Qt will still wait
for the second key to be pressed. That is, there is no way to instruct
Qt that Space and R keys should be pressed simultaneously (it is not
possible by design of QKeySequence.

This patch adds a workaround for the problem. It makes sure that all the
shortcut events are delivered to Krita, whatever the state Qt has
internally.

Test Plan
-

Configuration:

1) Assign W as a primary shortcut for Zoom-In in **Canvas Input Settings**
2) Assign Space,R as a primary shortcut for Zoom-Out in **Keyboard Shortcuts**
3) Assign Space,W as a primary shortcut Rotate Canvas Left in **Keyboard
Shortcuts**

Testcase 1:

1) Press Space, Release Space
2) Press W, Release W

Expected: canvas is zoomed in and not rotated, space+drag gesture still works
fine

Testcase 2:

1) Press Space, Release Space
2) Press W, Release W
2) Press R, Release R

Expected: no zoom-out action happens (because Space modifier has already been
consumed by the former action)

Testcase 3:

1) Press Space, Release Space
2) Press R, Release R

Expected: zoom-out action happens, space+drag gesture still works fine


Testcase 4:

Press Space, W and R randomly, it should still behave "in a sane way" :)

A  +68   -0   
3rdparty/ext_qt/0101-Don-t-eat-ShortcutOverride-events-when-there-is-a-pa.patch
M  +4-03rdparty/ext_qt/CMakeLists.txt
M  +6-8libs/ui/input/kis_input_manager.cpp

https://invent.kde.org/graphics/krita/commit/80bdcbdf22a009c06523d535de9e2dd682ffdb34

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-30 Thread Stig
https://bugs.kde.org/show_bug.cgi?id=409613

--- Comment #13 from Stig  ---
I didn't experience the bug while testing in the new package, seems to work for
me too! :)
Thank you! Dmitry

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-30 Thread Hector
https://bugs.kde.org/show_bug.cgi?id=409613

--- Comment #12 from Hector  ---
(In reply to Dmitry Kazakov from comment #11)

> I've added a merge request to Krita with the fix to the bug. Could you
> please test it and check if the bug is fixed?

The bug that I had no longer appears in this package. It seems to have checked
all the options that I had then.

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-29 Thread Dmitry Kazakov
https://bugs.kde.org/show_bug.cgi?id=409613

--- Comment #11 from Dmitry Kazakov  ---
Hi, Hector!

I've added a merge request to Krita with the fix to the bug. Could you please
test it and check if the bug is fixed?

Merge request: https://invent.kde.org/graphics/krita/-/merge_requests/403
Testing package for Windows: https://yadi.sk/d/3PkOJpffkExBcQ

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-29 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=409613

Bug Janitor Service  changed:

   What|Removed |Added

 Status|REOPENED|ASSIGNED

--- Comment #10 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/graphics/krita/-/merge_requests/403

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-29 Thread Dmitry Kazakov
https://bugs.kde.org/show_bug.cgi?id=409613

--- Comment #9 from Dmitry Kazakov  ---
Okay, the problem is the following:

Qt supports sequential shortcuts. That is, you can press "Space", release it,
and then press "R" key and the shortcut will be triggered. It means that when
you press Space the first time, Qt starts eating all the following
ShortcutOverride events and they never get delivered to Krita until Qt matches
the a complete shortcut or resets its state.

I need to think to understand if it is actually fixable or not.

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-29 Thread Dmitry Kazakov
https://bugs.kde.org/show_bug.cgi?id=409613

--- Comment #8 from Dmitry Kazakov  ---
This bug is actually in Qt. When Space is set as a shortcut modifier, it
doesn't handle KeyRelease for some reason, therefore internal state machine
gets into a invalid state and eats some events.

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-29 Thread Dmitry Kazakov
https://bugs.kde.org/show_bug.cgi?id=409613

Dmitry Kazakov  changed:

   What|Removed |Added

 Resolution|FIXED   |---
 Status|RESOLVED|REOPENED

--- Comment #7 from Dmitry Kazakov  ---
No, I think I can reproduce it still

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-29 Thread Dmitry Kazakov
https://bugs.kde.org/show_bug.cgi?id=409613

Dmitry Kazakov  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|CONFIRMED   |RESOLVED

--- Comment #6 from Dmitry Kazakov  ---
The bug has been fixed in this commit:

commit d454a04e713c0ffc4167021680f69be3698871ec
Author: Dmitry Kazakov , Wed Apr 15 23:46:55 2020 +0300 (3
months ago)

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.

BUG:372646,373299,391088

-- 
You are receiving this mail because:
You are watching all bug changes.

[krita] [Bug 409613] "Reset Canvas Rotation" set to "Space + R" breaks color picking after pan action

2020-06-18 Thread Dmitry Kazakov
https://bugs.kde.org/show_bug.cgi?id=409613

Dmitry Kazakov  changed:

   What|Removed |Added

Summary|Color picker shortcut   |"Reset Canvas Rotation" set
   |doesn't work after moving   |to "Space + R" breaks color
   |canvas with spacebar(pan|picking after pan action
   |tool shortcut)  |
 CC||dimul...@gmail.com
   Assignee|krita-bugs-n...@kde.org |dimul...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.