diff --git a/src/effects/overview/overvieweffect.cpp b/src/effects/overview/overvieweffect.cpp index d0cbe09a5a..d8d6a78bea 100644 --- a/src/effects/overview/overvieweffect.cpp +++ b/src/effects/overview/overvieweffect.cpp @@ -39,7 +39,14 @@ OverviewEffect::OverviewEffect() KGlobalAccel::self()->setShortcut(m_toggleAction, {defaultToggleShortcut}); m_toggleShortcut = KGlobalAccel::self()->shortcut(m_toggleAction); effects->registerGlobalShortcut({defaultToggleShortcut}, m_toggleAction); - effects->registerTouchpadSwipeShortcut(SwipeDirection::Up, 4, m_toggleAction); + effects->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Up, 4, new QAction(), [this](qreal cb) { //m_toggleAction + if (cb > .2 && !isRunning()) { + activate(); + } + if (cb <= .2 && isRunning()) { + deactivate(); + } + }); connect(effects, &EffectsHandler::screenAboutToLock, this, &OverviewEffect::realDeactivate); diff --git a/src/effects/presentwindows/presentwindows.cpp b/src/effects/presentwindows/presentwindows.cpp index 9f7e5fce19..c76b4c3c2a 100644 --- a/src/effects/presentwindows/presentwindows.cpp +++ b/src/effects/presentwindows/presentwindows.cpp @@ -82,7 +82,15 @@ PresentWindowsEffect::PresentWindowsEffect() KGlobalAccel::self()->setShortcut(exposeAllAction, QList() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC); shortcutAll = KGlobalAccel::self()->shortcut(exposeAllAction); effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F10, exposeAllAction); - effects->registerTouchpadSwipeShortcut(SwipeDirection::Down, 4, exposeAllAction); + effects->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Down, 4, new QAction(), [this](qreal cb) { //exposeAllAction + m_mode = ModeAllDesktops; + if (cb > .2 && !m_activated) { + setActive(true); + } + if (cb < .2 && m_activated) { + setActive(false); + } + }); connect(exposeAllAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActiveAllDesktops); QAction* exposeClassAction = m_exposeClassAction;