Bug 419306 - Advanced color selector not closing on keyboard inputs
Summary: Advanced color selector not closing on keyboard inputs
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Color Selectors (show other bugs)
Version: 4.2.9
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: wolthera
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-03-27 18:30 UTC by Wojtek Trybus
Modified: 2020-06-14 13:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wojtek Trybus 2020-03-27 18:30:59 UTC
SUMMARY
Pressing keyboard keys don't close the advanced color selector pop-up. Actions assigned to them are being performed instead.

STEPS TO REPRODUCE
1. Open color selector (shift+i)
2. try to close it with any key with action assigned to it

OBSERVED RESULT
The pop-up can be closed with unassigned keys, and those acting as modifiers (ctrl, shift, v...), and by assigned keys, if actions cannot be done (undo with nothing left in undo stack, or deselect if nothing is selected). Otherwise those actions are performed without closing the pop-up.

EXPECTED RESULT
Pop-up closed with any keyboard input.

SOFTWARE/OS VERSIONS
Windows: Windows 10
Linux/KDE Plasma: Kubuntu 19.04
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION
Reproduced on Windows 10. Regression occurred in Krita 4.2.9. Beta release was working well.
Comment 1 wolthera 2020-04-24 12:31:22 UTC
setting this to wishlist
Comment 2 Wojtek Trybus 2020-04-29 06:49:04 UTC
(In reply to wolthera from comment #1)
> setting this to wishlist

Of course, thank you, and sorry for the trouble.
I made the bug report as Tiar asked me to on Krita-artists - according to Linx3d it was a change made by Ivan Yossi to fix another issue, and I thought it was probably unintended.
Anyway it is not that severe, so I guess I will learn to live with it.
Comment 3 vanyossi 2020-05-12 22:33:21 UTC
Hello there, are you getting this issue on Kubuntu or in windows? on macos color selector closes with any action, also ig the cursor leaves the color selection.

We implemented a change in cea9741dd7dbb for fixing bug 418668 that probably introduced this bug on win and linux.
Comment 4 Wojtek Trybus 2020-05-13 07:22:14 UTC
(In reply to vanyossi from comment #3)
> Hello there, are you getting this issue on Kubuntu or in windows? on macos
> color selector closes with any action, also ig the cursor leaves the color
> selection.
> 
> We implemented a change in cea9741dd7dbb for fixing bug 418668 that probably
> introduced this bug on win and linux.

It happens in both kubuntu and windows 10. Closing on mouse leaving the popup works fine - it's only not closing on keyboard inputs, that can perform actions (actions are being done, popup stays as it was), and it used to react to any input without performing its action.
Comment 5 Lynx3d 2020-06-08 15:20:22 UTC
I think this is a result of these commits:
https://invent.kde.org/graphics/krita/-/commit/8621ed93b311bd8035390bb8063609b7b312dd24
https://invent.kde.org/graphics/krita/-/commit/cea9741dd7dbb37d4eaf812e7273d1c143c71217

From what I remember, the first solution broke platforms other than macOS and I suggested to check if the Qt::Tool window flag works for all, but it didn't work for macOS either.
Not sure why it was chosen for non-macOS in the end, but I wasn't aware that it changes behavior from the original flags either...
Comment 6 Halla Rempt 2020-06-12 12:27:32 UTC
Isn't this also fixed by 

commit 17e6e2841c245aa16eeb000f62f3e5717db7b657
Author: Mathias Wein <lynx.mw+kde@gmail.com>
Date:   Tue Jun 9 20:04:08 2020 +0200

    Remove old workaround for popup palette hiding
    

?
Comment 7 Lynx3d 2020-06-12 17:31:06 UTC
No, commit 17e6e2841c245aa16eeb000f62f3e5717db7b657 was only about (not) signalling when painting with a new color, to build a color history.
Shouldn't have any influence on the actual input handling.
Comment 8 wolthera 2020-06-14 13:05:48 UTC
Git commit 6dc22af666658742b2106ee5c3ac5bf4d25eed9e by Wolthera van Hövell tot Westerflier.
Committed on 14/06/2020 at 13:03.
Pushed by woltherav into branch 'master'.

Use qt::window instead of qt::tool for keyboard events in the popups.

The original code used the window hint instead of the tool hint, and
that seems to be required to receive keyboard events.

M  +1    -1    plugins/dockers/advancedcolorselector/kis_color_selector_base.cpp

https://invent.kde.org/graphics/krita/commit/6dc22af666658742b2106ee5c3ac5bf4d25eed9e
Comment 9 wolthera 2020-06-14 13:06:14 UTC
Git commit cb7612c632de3933ea7255f24813ec6da8f67e95 by Wolthera van Hövell tot Westerflier.
Committed on 14/06/2020 at 13:06.
Pushed by woltherav into branch 'krita/4.3'.

Use qt::window instead of qt::tool for keyboard events in the popups.

The original code used the window hint instead of the tool hint, and
that seems to be required to receive keyboard events.

M  +1    -1    plugins/dockers/advancedcolorselector/kis_color_selector_base.cpp

https://invent.kde.org/graphics/krita/commit/cb7612c632de3933ea7255f24813ec6da8f67e95
Comment 10 wolthera 2020-06-14 13:08:46 UTC
Git commit 4211ee84216dafb078539eefebcbfa85521c7fc7 by Wolthera van Hövell tot Westerflier.
Committed on 14/06/2020 at 13:08.
Pushed by woltherav into branch 'krita/4.3.0'.

Use qt::window instead of qt::tool for keyboard events in the popups.

The original code used the window hint instead of the tool hint, and
that seems to be required to receive keyboard events.

M  +1    -1    plugins/dockers/advancedcolorselector/kis_color_selector_base.cpp

https://invent.kde.org/graphics/krita/commit/4211ee84216dafb078539eefebcbfa85521c7fc7