Bug 409856 - Crash on shortcut conflict when Escape key is bound to Quit
Summary: Crash on shortcut conflict when Escape key is bound to Quit
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 19.04.2
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-16 10:20 UTC by Michal Mutl
Modified: 2019-08-24 22:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.12.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Mutl 2019-07-16 10:20:08 UTC
SUMMARY
When Kate has assigned Esc key as shortcut for Quit then after Quick Open activation when Esc key is pressed (to leave it) Kate crashes.

STEPS TO REPRODUCE
1. Assign Quit shortcut to Esc
2. Click on Quick Open
3. Press Esc

OBSERVED RESULT
Kate crashes with no error message

EXPECTED RESULT
Leave Quick Open

SOFTWARE/OS VERSIONS
Windows: 10 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Christoph Cullmann 2019-07-17 18:30:19 UTC
Could you try the nightly installer?

https://binary-factory.kde.org/view/Windows%2064-bit/job/Kate_Nightly_win64/

I thought I have fixed such a crash (that happened on Linux, too) in the last weeks.
Comment 2 Michal Mutl 2019-07-18 06:10:28 UTC
(In reply to Christoph Cullmann from comment #1)
> Could you try the nightly installer?
> 
> https://binary-factory.kde.org/view/Windows%2064-bit/job/Kate_Nightly_win64/
> 
> I thought I have fixed such a crash (that happened on Linux, too) in the
> last weeks.

Yes, this build is ok regarding to crash. But behaviour is wrong. Esc key should leave Quick Open but instead quits Kate. Yes Esc is assigned as Quit shortcut, but in this case Esc should really leave Quick Open. The same when user press Esc to leave e.g. configuration dialog. It also does not quit Kate but only leaves dialog.
Comment 3 Dominik Haumann 2019-07-18 08:14:08 UTC
In the configuration dialog you have a separate event loop, that's why ESC will likely just close the dialog. However, the quick open does not have its own dialog and is embedded in the main window. ESC simply triggers the application action for you, so this is expected behavior.

I think we should check once how ESC is caught in quick open, so we may be able to fix it. But it's really a corner case and not really a bug, imho.
Comment 4 Michal Mutl 2019-07-18 11:30:55 UTC
Yes, I know why it works in dialogs, I just say that it's illogical in Quick Open case.
Would it be problem to check whether Quick Open is opened and focused when Esc is pressed and if so only close it and do not quit Kate?
Comment 5 Christoph Cullmann 2019-08-24 20:40:50 UTC
Git commit 8a429fef3fcc412ee607b3834744a3e5248eb272 by Christoph Cullmann.
Committed on 24/08/2019 at 20:39.
Pushed by cullmann into branch 'master'.

allow ESC to be used as global application shortcut
and still exit the quick open

same approach as in KTextEditor e.g. search widget

M  +3    -1    kate/katequickopen.cpp

https://invent.kde.org/kde/kate/commit/8a429fef3fcc412ee607b3834744a3e5248eb272
Comment 6 Christoph Cullmann 2019-08-24 20:40:52 UTC
Git commit 8a429fef3fcc412ee607b3834744a3e5248eb272 by Christoph Cullmann.
Committed on 24/08/2019 at 20:39.
Pushed by scmsync into branch 'master'.

allow ESC to be used as global application shortcut
and still exit the quick open

same approach as in KTextEditor e.g. search widget

M  +3    -1    kate/katequickopen.cpp

https://commits.kde.org/kate/8a429fef3fcc412ee607b3834744a3e5248eb272