From 4dd5bfab09f239366ad22d56ac7a80253a05934a Mon Sep 17 00:00:00 2001 From: Nathaniel Graham Date: Tue, 20 Mar 2018 12:58:26 -0600 Subject: [PATCH] Remove "move zoomed area" shortcuts by default Summary: This is a follow-up for D11377, as requested by @graesslin. The patch removes the default shortcuts for the {nav Move zoomed area} actions. Test Plan: Deployed KWin with patch, killed and restarted KWin, created and logged into new user account, then zoomed in: - {key Meta Ctrl Arrows} do not move the zoomed view - The actions are still visible (without shortcuts) in {nav System Settings > Shortcuts > Global Shortcuts > KWin} - You can still set custom shortcuts for the actions, and they work Reviewers: #kwin, graesslin Reviewed By: #kwin, graesslin Subscribers: graesslin, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D11526 --- effects/zoom/zoom.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index 6719137151..1dd615053c 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -82,33 +82,33 @@ ZoomEffect::ZoomEffect() a = new QAction(this); a->setObjectName(QStringLiteral("MoveZoomLeft")); a->setText(i18n("Move Zoomed Area to Left")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Left); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Left); - effects->registerGlobalShortcut(Qt::META + Qt::CTRL + Qt::Key_Left, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList()); + KGlobalAccel::self()->setShortcut(a, QList()); + effects->registerGlobalShortcut(QKeySequence(), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomLeft())); a = new QAction(this); a->setObjectName(QStringLiteral("MoveZoomRight")); a->setText(i18n("Move Zoomed Area to Right")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Right); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Right); - effects->registerGlobalShortcut(Qt::META + Qt::CTRL + Qt::Key_Right, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList()); + KGlobalAccel::self()->setShortcut(a, QList()); + effects->registerGlobalShortcut(QKeySequence(), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomRight())); a = new QAction(this); a->setObjectName(QStringLiteral("MoveZoomUp")); a->setText(i18n("Move Zoomed Area Upwards")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Up); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Up); - effects->registerGlobalShortcut(Qt::META + Qt::CTRL + Qt::Key_Up, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList()); + KGlobalAccel::self()->setShortcut(a, QList()); + effects->registerGlobalShortcut(QKeySequence(), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomUp())); a = new QAction(this); a->setObjectName(QStringLiteral("MoveZoomDown")); a->setText(i18n("Move Zoomed Area Downwards")); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Down); - KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_Down); - effects->registerGlobalShortcut(Qt::META + Qt::CTRL + Qt::Key_Down, a); + KGlobalAccel::self()->setDefaultShortcut(a, QList()); + KGlobalAccel::self()->setShortcut(a, QList()); + effects->registerGlobalShortcut(QKeySequence(), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomDown())); // TODO: these two actions don't belong into the effect. They need to be moved into KWin core