Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
a5c6d3e9
Commit
a5c6d3e9
authored
Aug 05, 2022
by
Pablo Rauzy
Committed by
Christoph Cullmann
Aug 14, 2022
Browse files
pause macro recording when app is out of focus also because of app suspend
parent
0c03e0c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/keyboardmacros/keyboardmacrosplugin.cpp
View file @
a5c6d3e9
...
...
@@ -321,7 +321,7 @@ void KeyboardMacrosPlugin::focusObjectChanged(QObject *focusObject)
{
qCDebug
(
KM_DBG
)
<<
"focusObjectChanged:"
<<
focusObject
;
QPointer
<
QWidget
>
focusWidget
=
qobject_cast
<
QWidget
*>
(
focusObject
);
if
(
focusWidget
==
nullptr
||
focusWidget
==
m_focusWidget
)
{
if
(
focusWidget
==
nullptr
)
{
return
;
}
// update which widget we filter events from when the focus has changed
...
...
@@ -338,12 +338,11 @@ void KeyboardMacrosPlugin::applicationStateChanged(Qt::ApplicationState state)
// somehow keeping our event filter on while the app is out of focus made Kate crash, we fix that here
switch
(
state
)
{
case
Qt
::
ApplicationSuspended
:
sendMessage
(
i18n
(
"Application suspended, aborting record."
),
true
);
cancel
();
break
;
case
Qt
::
ApplicationHidden
:
case
Qt
::
ApplicationInactive
:
m_focusWidget
->
removeEventFilter
(
this
);
if
(
m_focusWidget
!=
nullptr
)
{
m_focusWidget
->
removeEventFilter
(
this
);
}
break
;
case
Qt
::
ApplicationActive
:
break
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment