Commit 9a31b0d7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

x11: trigger shortcuts when releasing rather than pressing

This way we can issue a keyboard grab without problems
parent 1f443301
......@@ -40,6 +40,7 @@
#include <KConfigGroup>
#include <KCrash>
#include <KGlobalAccel>
#include <KLocalizedString>
#include <QOpenGLContext>
......@@ -368,7 +369,10 @@ void X11StandalonePlatform::startInteractivePositionSelection(std::function<void
void X11StandalonePlatform::setupActionForGlobalAccel(QAction *action)
{
connect(action, &QAction::triggered, kwinApp(), [action] {
connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutActiveChanged, kwinApp(), [action](QAction *triggeredAction, bool active) {
if (triggeredAction != action)
return;
QVariant timestamp = action->property("org.kde.kglobalaccel.activationTimestamp");
bool ok = false;
const quint32 t = timestamp.toULongLong(&ok);
......
Supports Markdown
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