Change CommandAllKey to Meta
Summary: Alt + Left Click to move windows has a tendency to conflict with creative workflow apps. While Alt can be changed to Meta in KWin's settings, Alt + Left Click shortcuts often cannot be customized in apps. Rather than making every user who runs into this problem change their settings, we should change our default settings to improve KWin's default usability. The fact that Alt + Left Click to move windows is older does not matter. We are trying to use Meta for global/shell shortcuts anyway. BUG: 399375 Test Plan: The relevant parts of the relevant tests pass. kwin-testInternalWindow fails, but for unrelated reasons that have something to do with XWayland.
This commit is contained in:
parent
85b9aea5b4
commit
f474686a58
9 changed files with 33 additions and 33 deletions
|
@ -605,13 +605,13 @@ void InternalWindowTest::testModifierClickUnrestrictedMove()
|
|||
QVERIFY(internalClient->isDecorated());
|
||||
|
||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||
group.writeEntry("CommandAllKey", "Alt");
|
||||
group.writeEntry("CommandAllKey", "Meta");
|
||||
group.writeEntry("CommandAll1", "Move");
|
||||
group.writeEntry("CommandAll2", "Move");
|
||||
group.writeEntry("CommandAll3", "Move");
|
||||
group.sync();
|
||||
workspace()->slotReconfigure();
|
||||
QCOMPARE(options->commandAllModifier(), Qt::AltModifier);
|
||||
QCOMPARE(options->commandAllModifier(), Qt::MetaModifier);
|
||||
QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove);
|
||||
QCOMPARE(options->commandAll2(), Options::MouseUnrestrictedMove);
|
||||
QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove);
|
||||
|
@ -621,12 +621,12 @@ void InternalWindowTest::testModifierClickUnrestrictedMove()
|
|||
|
||||
// simulate modifier+click
|
||||
quint32 timestamp = 1;
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
|
||||
QVERIFY(!internalClient->isMove());
|
||||
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++);
|
||||
QVERIFY(internalClient->isMove());
|
||||
// release modifier should not change it
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
|
||||
QVERIFY(internalClient->isMove());
|
||||
// but releasing the key should end move/resize
|
||||
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++);
|
||||
|
@ -647,7 +647,7 @@ void InternalWindowTest::testModifierScroll()
|
|||
QVERIFY(internalClient->isDecorated());
|
||||
|
||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||
group.writeEntry("CommandAllKey", "Alt");
|
||||
group.writeEntry("CommandAllKey", "Meta");
|
||||
group.writeEntry("CommandAllWheel", "change opacity");
|
||||
group.sync();
|
||||
workspace()->slotReconfigure();
|
||||
|
@ -659,12 +659,12 @@ void InternalWindowTest::testModifierScroll()
|
|||
internalClient->setOpacity(0.5);
|
||||
QCOMPARE(internalClient->opacity(), 0.5);
|
||||
quint32 timestamp = 1;
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
|
||||
kwinApp()->platform()->pointerAxisVertical(-5, timestamp++);
|
||||
QCOMPARE(internalClient->opacity(), 0.6);
|
||||
kwinApp()->platform()->pointerAxisVertical(5, timestamp++);
|
||||
QCOMPARE(internalClient->opacity(), 0.5);
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
|
||||
}
|
||||
|
||||
void InternalWindowTest::testPopup()
|
||||
|
|
|
@ -179,14 +179,14 @@ void TestPointerConstraints::testConfinedPointer()
|
|||
// modifier + click should be ignored
|
||||
// first ensure the settings are ok
|
||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||
group.writeEntry("CommandAllKey", QStringLiteral("Alt"));
|
||||
group.writeEntry("CommandAllKey", QStringLiteral("Meta"));
|
||||
group.writeEntry("CommandAll1", "Move");
|
||||
group.writeEntry("CommandAll2", "Move");
|
||||
group.writeEntry("CommandAll3", "Move");
|
||||
group.writeEntry("CommandAllWheel", "change opacity");
|
||||
group.sync();
|
||||
workspace()->slotReconfigure();
|
||||
QCOMPARE(options->commandAllModifier(), Qt::AltModifier);
|
||||
QCOMPARE(options->commandAllModifier(), Qt::MetaModifier);
|
||||
QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove);
|
||||
QCOMPARE(options->commandAll2(), Options::MouseUnrestrictedMove);
|
||||
QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove);
|
||||
|
|
|
@ -485,13 +485,13 @@ void PointerInputTest::testModifierClickUnrestrictedMoveGlobalShortcutsDisabled(
|
|||
|
||||
// first modify the config for this run
|
||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||
group.writeEntry("CommandAllKey", "Alt");
|
||||
group.writeEntry("CommandAllKey", "Meta");
|
||||
group.writeEntry("CommandAll1", "Move");
|
||||
group.writeEntry("CommandAll2", "Move");
|
||||
group.writeEntry("CommandAll3", "Move");
|
||||
group.sync();
|
||||
workspace()->slotReconfigure();
|
||||
QCOMPARE(options->commandAllModifier(), Qt::AltModifier);
|
||||
QCOMPARE(options->commandAllModifier(), Qt::MetaModifier);
|
||||
QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove);
|
||||
QCOMPARE(options->commandAll2(), Options::MouseUnrestrictedMove);
|
||||
QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove);
|
||||
|
@ -518,12 +518,12 @@ void PointerInputTest::testModifierClickUnrestrictedMoveGlobalShortcutsDisabled(
|
|||
|
||||
// simulate modifier+click
|
||||
quint32 timestamp = 1;
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
|
||||
QVERIFY(!window->isMove());
|
||||
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++);
|
||||
QVERIFY(!window->isMove());
|
||||
// release modifier should not change it
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
|
||||
QVERIFY(!window->isMove());
|
||||
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++);
|
||||
|
||||
|
@ -623,7 +623,7 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled()
|
|||
|
||||
// first modify the config for this run
|
||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||
group.writeEntry("CommandAllKey", "Alt");
|
||||
group.writeEntry("CommandAllKey", "Meta");
|
||||
group.writeEntry("CommandAllWheel", "change opacity");
|
||||
group.sync();
|
||||
workspace()->slotReconfigure();
|
||||
|
@ -653,12 +653,12 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled()
|
|||
|
||||
// simulate modifier+wheel
|
||||
quint32 timestamp = 1;
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
|
||||
kwinApp()->platform()->pointerAxisVertical(-5, timestamp++);
|
||||
QCOMPARE(window->opacity(), 0.5);
|
||||
kwinApp()->platform()->pointerAxisVertical(5, timestamp++);
|
||||
QCOMPARE(window->opacity(), 0.5);
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
|
||||
|
||||
workspace()->disableGlobalShortcutsForClient(false);
|
||||
}
|
||||
|
@ -1487,11 +1487,11 @@ void PointerInputTest::testResizeCursor()
|
|||
|
||||
// first modify the config for this run
|
||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||
group.writeEntry("CommandAllKey", "Alt");
|
||||
group.writeEntry("CommandAllKey", "Meta");
|
||||
group.writeEntry("CommandAll3", "Resize");
|
||||
group.sync();
|
||||
workspace()->slotReconfigure();
|
||||
QCOMPARE(options->commandAllModifier(), Qt::AltModifier);
|
||||
QCOMPARE(options->commandAllModifier(), Qt::MetaModifier);
|
||||
QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedResize);
|
||||
|
||||
// create a test client
|
||||
|
@ -1532,7 +1532,7 @@ void PointerInputTest::testResizeCursor()
|
|||
|
||||
// start resizing the client
|
||||
int timestamp = 1;
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
|
||||
kwinApp()->platform()->pointerButtonPressed(BTN_RIGHT, timestamp++);
|
||||
QVERIFY(c->isResize());
|
||||
|
||||
|
@ -1543,7 +1543,7 @@ void PointerInputTest::testResizeCursor()
|
|||
QCOMPARE(kwinApp()->platform()->cursorImage().hotSpot(), resizeCursor.hotSpot());
|
||||
|
||||
// finish resizing the client
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
|
||||
kwinApp()->platform()->pointerButtonReleased(BTN_RIGHT, timestamp++);
|
||||
QVERIFY(!c->isResize());
|
||||
|
||||
|
@ -1557,11 +1557,11 @@ void PointerInputTest::testMoveCursor()
|
|||
|
||||
// first modify the config for this run
|
||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||
group.writeEntry("CommandAllKey", "Alt");
|
||||
group.writeEntry("CommandAllKey", "Meta");
|
||||
group.writeEntry("CommandAll1", "Move");
|
||||
group.sync();
|
||||
workspace()->slotReconfigure();
|
||||
QCOMPARE(options->commandAllModifier(), Qt::AltModifier);
|
||||
QCOMPARE(options->commandAllModifier(), Qt::MetaModifier);
|
||||
QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove);
|
||||
|
||||
// create a test client
|
||||
|
@ -1583,7 +1583,7 @@ void PointerInputTest::testMoveCursor()
|
|||
|
||||
// start moving the client
|
||||
int timestamp = 1;
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTMETA, timestamp++);
|
||||
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++);
|
||||
QVERIFY(c->isMove());
|
||||
|
||||
|
@ -1593,7 +1593,7 @@ void PointerInputTest::testMoveCursor()
|
|||
QCOMPARE(kwinApp()->platform()->cursorImage().hotSpot(), sizeAllCursor.hotSpot());
|
||||
|
||||
// finish moving the client
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
||||
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTMETA, timestamp++);
|
||||
kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++);
|
||||
QVERIFY(!c->isMove());
|
||||
|
||||
|
|
|
@ -443,7 +443,7 @@ the window.
|
|||
|
||||
<para>
|
||||
This bottom section, allows you to configure additional actions, when
|
||||
a modifier key (by default &Alt;) is pressed, and a mouse click is
|
||||
a modifier key (by default &Meta;) is pressed, and a mouse click is
|
||||
made on a window.</para>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -206,12 +206,12 @@
|
|||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Alt</string>
|
||||
<string>Meta</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Meta</string>
|
||||
<string>Alt</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
|
|
@ -296,10 +296,10 @@
|
|||
</entry>
|
||||
|
||||
<entry key="CommandAllKey" type="Enum">
|
||||
<default>Alt</default>
|
||||
<default>Meta</default>
|
||||
<choices>
|
||||
<choice name="Alt"></choice>
|
||||
<choice name="Meta"></choice>
|
||||
<choice name="Alt"></choice>
|
||||
</choices>
|
||||
</entry>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<default>Nothing</default>
|
||||
</entry>
|
||||
<entry name="CommandAllKey" type="String">
|
||||
<default>Alt</default>
|
||||
<default>Meta</default>
|
||||
</entry>
|
||||
<entry name="CommandAllWheel" type="String">
|
||||
<default>Nothing</default>
|
||||
|
|
|
@ -765,7 +765,7 @@ void Options::loadConfig()
|
|||
config = KConfigGroup(m_settings->config(), "MouseBindings");
|
||||
// TODO: add properties for missing options
|
||||
CmdTitlebarWheel = mouseWheelCommand(config.readEntry("CommandTitlebarWheel", "Nothing"));
|
||||
CmdAllModKey = (config.readEntry("CommandAllKey", "Alt") == QStringLiteral("Meta")) ? Qt::Key_Meta : Qt::Key_Alt;
|
||||
CmdAllModKey = (config.readEntry("CommandAllKey", "Meta") == QStringLiteral("Meta")) ? Qt::Key_Meta : Qt::Key_Alt;
|
||||
CmdAllWheel = mouseWheelCommand(config.readEntry("CommandAllWheel", "Nothing"));
|
||||
setCommandActiveTitlebar1(mouseCommand(config.readEntry("CommandActiveTitlebar1", "Raise"), true));
|
||||
setCommandActiveTitlebar2(mouseCommand(config.readEntry("CommandActiveTitlebar2", "Nothing"), true));
|
||||
|
@ -963,7 +963,7 @@ void Options::reloadCompositingSettings(bool force)
|
|||
// restricted should be true for operations that the user may not be able to repeat
|
||||
// if the window is moved out of the workspace (e.g. if the user moves a window
|
||||
// by the titlebar, and moves it too high beneath Kicker at the top edge, they
|
||||
// may not be able to move it back, unless they know about Alt+LMB)
|
||||
// may not be able to move it back, unless they know about Meta+LMB)
|
||||
Options::WindowOperation Options::windowOperation(const QString &name, bool restricted)
|
||||
{
|
||||
if (name == QStringLiteral("Move"))
|
||||
|
|
|
@ -1330,7 +1330,7 @@ void Workspace::disableGlobalShortcutsForClient(bool disable)
|
|||
QDBusConnection::sessionBus().asyncCall(message);
|
||||
|
||||
global_shortcuts_disabled_for_client = disable;
|
||||
// Update also Alt+LMB actions etc.
|
||||
// Update also Meta+LMB actions etc.
|
||||
for (auto it = clients.constBegin();
|
||||
it != clients.constEnd();
|
||||
++it)
|
||||
|
|
Loading…
Reference in a new issue