Bug 344333

Summary: Krita crashes when you activate the primary tool with a keyboard shortcut
Product: [Applications] krita Reporter: arturg <var.spool.mail700>
Component: UsabilityAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: dimula73, ghevan, halla
Priority: NOR    
Version: 2.9 Beta   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description arturg 2015-02-18 21:43:49 UTC
when you assign a key combination to activate the primary tool then try to activate the tool 
krita segfaults.

Reproducible: Always

Steps to Reproduce:
1.go to Settings/Configure Krita/Canvas Input Settings/Tool Invocation and select 
Type: Key Combination, Input: any key, Action: Activate
2.hit ok and try to activate the tool e.g. Freehand Brush Tool
3.

Actual Results:  
Krita segfaults

Expected Results:  
activate the tool at the mouse position
Comment 1 Halla Rempt 2015-02-18 21:58:06 UTC
Hi,

Thanks for the report. I can reproduce the bug -- I get the following backtrace:

Thread 1 (Thread 0x7f06af805880 (LWP 10379)):
[KCrash Handler]
#5  type (this=0x0) at /usr/include/QtCore/qcoreevent.h:303
#6  KisToolProxy::forwardEvent (this=0x5c3b760, state=state@entry=KisToolProxy::BEGIN, action=action@entry=KisTool::Primary, event=event@entry=0x0, originalEvent=originalEvent@entry=0x0, lastTabletEvent=lastTabletEvent@entry=0x0) at /home/boud/kde/src/calligra/krita/ui/canvas/kis_tool_proxy.cpp:136
#7  0x00007f06af073026 in KisToolInvocationAction::begin (this=this@entry=0x3b523d0, shortcut=<optimized out>, event=event@entry=0x0) at /home/boud/kde/src/calligra/krita/ui/input/kis_tool_invocation_action.cpp:103
#8  0x00007f06af081a56 in KisShortcutMatcher::tryRunSingleActionShortcutImpl<Qt::Key, QKeyEvent> (this=this@entry=0x3bda3c0, param=param@entry=Qt::Key_D, event=event@entry=0x0, keysState=...) at /home/boud/kde/src/calligra/krita/ui/input/kis_shortcut_matcher.cpp:355
#9  0x00007f06af0806f9 in KisShortcutMatcher::tryRunKeyShortcut (this=this@entry=0x3bda3c0, key=Qt::Key_D, event=event@entry=0x0) at /home/boud/kde/src/calligra/krita/ui/input/kis_shortcut_matcher.cpp:336
#10 0x00007f06af080d04 in KisShortcutMatcher::keyPressed (this=this@entry=0x3bda3c0, key=Qt::Key_D) at /home/boud/kde/src/calligra/krita/ui/input/kis_shortcut_matcher.cpp:116
#11 0x00007f06af06e8d7 in KisInputManager::eventFilter (this=0x3abab60, object=<optimized out>, event=0x7fff1a8f6680) at /home/boud/kde/src/calligra/krita/ui/input/kis_input_manager.cpp:652
#12 0x00007f06a7df6216 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x5e9ae80, event=0x7fff1a8f6680) at kernel/qcoreapplication.cpp:1059
#13 0x00007f06a880488c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#14 0x00007f06a880c0c1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#15 0x00007f06af0b3bc7 in KisApplication::notify (this=<optimized out>, receiver=0x5e9ae80, event=0x7fff1a8f6680) at /home/boud/kde/src/calligra/krita/ui/KisApplication.cpp:488
#16 0x00007f06a7df60ad in QCoreApplication::notifyInternal (this=0x7fff1a8f71d0, receiver=0x5e9ae80, event=0x7fff1a8f6680) at kernel/qcoreapplication.cpp:949
#17 0x00007f06a8835c3c in ?? () from /usr/lib64/libQtGui.so.4
#18 0x00007f06a880c143 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#19 0x00007f06af0b3bc7 in KisApplication::notify (this=<optimized out>, receiver=0x5e9ae80, event=0x7fff1a8f6680) at /home/boud/kde/src/calligra/krita/ui/KisApplication.cpp:488
#20 0x00007f06a7df60ad in QCoreApplication::notifyInternal (this=0x7fff1a8f71d0, receiver=0x5e9ae80, event=0x7fff1a8f6680) at kernel/qcoreapplication.cpp:949
#21 0x00007f06a889ed79 in ?? () from /usr/lib64/libQtGui.so.4
#22 0x00007f06a889f119 in ?? () from /usr/lib64/libQtGui.so.4
#23 0x00007f06a887ad3f in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
#24 0x00007f06a88a21f0 in ?? () from /usr/lib64/libQtGui.so.4
#25 0x00007f06a7df4d0f in QEventLoop::processEvents (this=this@entry=0x7fff1a8f6e70, flags=...) at kernel/qeventloop.cpp:149
#26 0x00007f06a7df5005 in QEventLoop::exec (this=this@entry=0x7fff1a8f6e70, flags=...) at kernel/qeventloop.cpp:204
#27 0x00007f06a7dfa13b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
Comment 2 Dmitry Kazakov 2015-02-20 10:03:22 UTC
The tool activation actions are expected to activate a stroke with "Mouse Button" action only. The only thing I can do here is to explicitly forbig choosing such shortcuts for tool actions
Comment 3 Halla Rempt 2015-02-20 10:42:52 UTC
I agree -- let's just make the choice impossible.
Comment 4 arturg 2015-02-20 20:25:27 UTC
hm if there is no other way then i guess its ok
Comment 5 arturg 2015-02-20 21:19:45 UTC
this bug is based on this thread:
https://forum.kde.org/viewtopic.php?f=137&t=124917
which limits the buttons you can use to mouse buttons.

and i was also thinking about some sort of activate brush toggle where you press a button/key and the brush stays active no matter if you press the stylus on the pad to use the pressure sensor or hover over it.
then with the airbrush you have 2 ways to deactivate it
temporary: with the wheel by controlling the size/opacity and
permanently: by pressing the button/key
Comment 6 Halla Rempt 2016-10-31 15:22:39 UTC
*** Bug 336991 has been marked as a duplicate of this bug. ***
Comment 7 Halla Rempt 2016-11-03 13:47:38 UTC
Git commit ca63c0aa0234a7bee169c2ee84ef4e15ce2bb219 by Boudewijn Rempt.
Committed on 03/11/2016 at 13:47.
Pushed by rempt into branch 'krita/3.1'.

M  +9    -4    libs/ui/canvas/kis_tool_proxy.cpp

http://commits.kde.org/krita/ca63c0aa0234a7bee169c2ee84ef4e15ce2bb219
Comment 8 Halla Rempt 2016-11-03 13:47:47 UTC
Git commit a83b7360c619f1f9bc4564bca8c485ba5c863b9d by Boudewijn Rempt.
Committed on 03/11/2016 at 13:47.
Pushed by rempt into branch 'rempt/impex-refactoring'.

M  +9    -4    libs/ui/canvas/kis_tool_proxy.cpp

http://commits.kde.org/krita/a83b7360c619f1f9bc4564bca8c485ba5c863b9d