Verified Commit 761cea04 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

effects/windowview: Make sure "Toggle Present Windows…" shortcuts are initialized

The last fix was not complete without registering the shortcut from the
start. It worked after changing it in system settings at runtime though.

Amends 984388db.

(cherry picked from commit f2defd1d)
parent e73716d4
Pipeline #235566 passed with stage
in 11 minutes and 39 seconds
......@@ -56,7 +56,7 @@ WindowViewEffect::WindowViewEffect()
KGlobalAccel::self()->setDefaultShortcut(m_exposeAllAction, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC);
KGlobalAccel::self()->setShortcut(m_exposeAllAction, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC);
m_shortcutAll = KGlobalAccel::self()->shortcut(m_exposeAllAction);
effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F10, m_exposeAllAction);
effects->registerGlobalShortcut(Qt::CTRL | Qt::Key_F10, m_exposeAllAction);
connect(m_exposeAllAction, &QAction::triggered, this, [this]() {
toggleMode(ModeAllDesktops);
});
......@@ -65,6 +65,7 @@ WindowViewEffect::WindowViewEffect()
m_exposeClassAction->setText(i18n("Toggle Present Windows (Window class)"));
KGlobalAccel::self()->setDefaultShortcut(m_exposeClassAction, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F7));
KGlobalAccel::self()->setShortcut(m_exposeClassAction, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F7));
m_shortcutClass = KGlobalAccel::self()->shortcut(m_exposeClassAction);
effects->registerGlobalShortcut(Qt::CTRL | Qt::Key_F7, m_exposeClassAction);
connect(m_exposeClassAction, &QAction::triggered, this, [this]() {
toggleMode(ModeWindowClass);
......@@ -72,6 +73,9 @@ WindowViewEffect::WindowViewEffect()
m_exposeClassCurrentDesktopAction->setObjectName(QStringLiteral("ExposeClassCurrentDesktop"));
m_exposeClassCurrentDesktopAction->setText(i18n("Toggle Present Windows (Window class on current desktop)"));
KGlobalAccel::self()->setDefaultShortcut(m_exposeClassCurrentDesktopAction, QList<QKeySequence>()); // no default shortcut
KGlobalAccel::self()->setShortcut(m_exposeClassCurrentDesktopAction, QList<QKeySequence>());
m_shortcutClassCurrentDesktop = KGlobalAccel::self()->shortcut(m_exposeClassCurrentDesktopAction);
effects->registerGlobalShortcut(QKeySequence{}, m_exposeClassCurrentDesktopAction);
connect(m_exposeClassCurrentDesktopAction, &QAction::triggered, this, [this]() {
toggleMode(ModeWindowClassCurrentDesktop);
......
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