Commit 35c55d4a authored by Martin Koller's avatar Martin Koller
Browse files

Don't grab/release keyboard to get key events. Use setFocus() instead

BUG: 405991
FIXED-IN: 20.12
parent 827ee774
...@@ -197,7 +197,6 @@ void kpGrip::cancel () ...@@ -197,7 +197,6 @@ void kpGrip::cancel ()
setCursor (Qt::ArrowCursor); setCursor (Qt::ArrowCursor);
m_shouldReleaseMouseButtons = true; m_shouldReleaseMouseButtons = true;
releaseKeyboard ();
emit cancelledDraw (); emit cancelledDraw ();
} }
...@@ -224,7 +223,7 @@ void kpGrip::mousePressEvent (QMouseEvent *e) ...@@ -224,7 +223,7 @@ void kpGrip::mousePressEvent (QMouseEvent *e)
m_startPoint = e->pos (); m_startPoint = e->pos ();
m_currentPoint = e->pos (); m_currentPoint = e->pos ();
emit beganDraw (); emit beganDraw ();
grabKeyboard (); setFocus(); // allow to receive keyboard events to be able to handle ESC
setUserMessage (i18n ("Resize Image: Right click to cancel.")); setUserMessage (i18n ("Resize Image: Right click to cancel."));
setCursor (cursorForType (m_type)); setCursor (cursorForType (m_type));
...@@ -310,7 +309,6 @@ void kpGrip::mouseReleaseEvent (QMouseEvent *e) ...@@ -310,7 +309,6 @@ void kpGrip::mouseReleaseEvent (QMouseEvent *e)
m_currentPoint = KP_INVALID_POINT; m_currentPoint = KP_INVALID_POINT;
m_startPoint = KP_INVALID_POINT; m_startPoint = KP_INVALID_POINT;
releaseKeyboard ();
emit endedDraw ((m_type & kpGrip::Right) ? dx : 0, emit endedDraw ((m_type & kpGrip::Right) ? dx : 0,
(m_type & kpGrip::Bottom) ? dy : 0); (m_type & kpGrip::Bottom) ? dy : 0);
} }
...@@ -321,7 +319,6 @@ void kpGrip::mouseReleaseEvent (QMouseEvent *e) ...@@ -321,7 +319,6 @@ void kpGrip::mouseReleaseEvent (QMouseEvent *e)
setUserMessage(QString()); setUserMessage(QString());
setCursor (cursorForType (m_type)); setCursor (cursorForType (m_type));
releaseKeyboard ();
emit releasedAllButtons (); emit releasedAllButtons ();
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment