[plasma/kwin] /: Change CommandAllKey to Meta

Noah Davis null at kde.org
Sun May 24 08:27:53 BST 2020


Git commit f474686a584a0f3049b3eddb8b148d3703a7148a by Noah Davis.
Committed on 23/05/2020 at 02:39.
Pushed by ndavis into branch 'master'.

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.

M  +7    -7    autotests/integration/internal_window.cpp
M  +2    -2    autotests/integration/pointer_constraints_test.cpp
M  +15   -15   autotests/integration/pointer_input.cpp
M  +1    -1    doc/windowbehaviour/index.docbook
M  +2    -2    kcmkwin/kwinoptions/actions.ui
M  +2    -2    kcmkwin/kwinoptions/kwinoptions_settings.kcfg
M  +1    -1    kwin.kcfg
M  +2    -2    options.cpp
M  +1    -1    workspace.cpp

https://invent.kde.org/plasma/kwin/commit/f474686a584a0f3049b3eddb8b148d3703a7148a

diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp
index 23d039a9b0..4dd9e35204 100644
--- a/autotests/integration/internal_window.cpp
+++ b/autotests/integration/internal_window.cpp
@@ -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()
diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp
index b2b997dbe6..adbf351bc9 100644
--- a/autotests/integration/pointer_constraints_test.cpp
+++ b/autotests/integration/pointer_constraints_test.cpp
@@ -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);
diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp
index db38d8c42b..fe7fd27c9f 100644
--- a/autotests/integration/pointer_input.cpp
+++ b/autotests/integration/pointer_input.cpp
@@ -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());
 
diff --git a/doc/windowbehaviour/index.docbook b/doc/windowbehaviour/index.docbook
index 75060404f7..75f0305563 100644
--- a/doc/windowbehaviour/index.docbook
+++ b/doc/windowbehaviour/index.docbook
@@ -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>
diff --git a/kcmkwin/kwinoptions/actions.ui b/kcmkwin/kwinoptions/actions.ui
index a525bb7f7d..7614c51289 100644
--- a/kcmkwin/kwinoptions/actions.ui
+++ b/kcmkwin/kwinoptions/actions.ui
@@ -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>
diff --git a/kcmkwin/kwinoptions/kwinoptions_settings.kcfg b/kcmkwin/kwinoptions/kwinoptions_settings.kcfg
index 3ee260af01..770b2805e8 100644
--- a/kcmkwin/kwinoptions/kwinoptions_settings.kcfg
+++ b/kcmkwin/kwinoptions/kwinoptions_settings.kcfg
@@ -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>
 
diff --git a/kwin.kcfg b/kwin.kcfg
index 861b6c9943..a9b11a6d2a 100644
--- a/kwin.kcfg
+++ b/kwin.kcfg
@@ -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>
diff --git a/options.cpp b/options.cpp
index 63f922cf6d..060a0cec27 100644
--- a/options.cpp
+++ b/options.cpp
@@ -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"))
diff --git a/workspace.cpp b/workspace.cpp
index d2892ac7d8..5b6524495b 100644
--- a/workspace.cpp
+++ b/workspace.cpp
@@ -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)


More information about the kde-doc-english mailing list