[plasma/kwin] /: placement: remove cascaded placement policy

Natalie Clarius null at kde.org
Fri Dec 2 15:03:06 GMT 2022


Git commit b6412454c24e1f3bb79b9d52f56d4b0f8417ac24 by Natalie Clarius.
Committed on 02/12/2022 at 14:05.
Pushed by ngraham into branch 'master'.

placement: remove cascaded placement policy

becomes redundant with cascade-if-covering for zero-cornered placement

M  +4    -22   autotests/integration/placement_test.cpp
M  +0    -9    doc/windowbehaviour/index.docbook
M  +0    -1    doc/windowspecific/index.docbook
M  +1    -6    src/kcmkwin/kwinoptions/advanced.ui
M  +0    -1    src/kcmkwin/kwinoptions/kwinoptions_settings.kcfg
M  +0    -1    src/kcmkwin/kwinoptions/windows.cpp
M  +0    -1    src/kcmkwin/kwinrules/rulesmodel.cpp
M  +0    -1    src/kwin.kcfg
M  +0    -1    src/options.h
M  +1    -4    src/placement.cpp

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

diff --git a/autotests/integration/placement_test.cpp b/autotests/integration/placement_test.cpp
index b4fd2aa306..1b4f1cd757 100644
--- a/autotests/integration/placement_test.cpp
+++ b/autotests/integration/placement_test.cpp
@@ -43,12 +43,11 @@ private Q_SLOTS:
     void initTestCase();
 
     void testPlaceSmart();
-    void testPlaceZeroCornered();
     void testPlaceMaximized();
     void testPlaceMaximizedLeavesFullscreen();
     void testPlaceCentered();
     void testPlaceUnderMouse();
-    void testPlaceCascaded();
+    void testPlaceZeroCornered();
     void testPlaceRandom();
     void testFullscreen();
 
@@ -151,23 +150,6 @@ void TestPlacement::testPlaceSmart()
     }
 }
 
-void TestPlacement::testPlaceZeroCornered()
-{
-    setPlacementPolicy(PlacementZeroCornered);
-
-    std::vector<std::unique_ptr<KWayland::Client::Surface>> surfaces;
-    for (int i = 0; i < 4; i++) {
-        auto [windowPlacement, surface] = createAndPlaceWindow(QSize(600, 500));
-        // smart placement shouldn't define a size on windows
-        QCOMPARE(windowPlacement.initiallyConfiguredSize, QSize(0, 0));
-        // size should match our buffer
-        QCOMPARE(windowPlacement.finalGeometry.size(), QSize(600, 500));
-        // and it should be in the corner
-        QCOMPARE(windowPlacement.finalGeometry.topLeft(), QPoint(0, 0));
-        surfaces.push_back(std::move(surface));
-    }
-}
-
 void TestPlacement::testPlaceMaximized()
 {
     setPlacementPolicy(PlacementMaximizing);
@@ -271,12 +253,12 @@ void TestPlacement::testPlaceUnderMouse()
     QVERIFY(Test::waitForWindowDestroyed(window));
 }
 
-void TestPlacement::testPlaceCascaded()
+void TestPlacement::testPlaceZeroCornered()
 {
-    // This test verifies that Cascaded placement policy works.
+    // This test verifies that the Zero-Cornered placement policy works.
 
     KConfigGroup group = kwinApp()->config()->group("Windows");
-    group.writeEntry("Placement", Placement::policyToString(PlacementCascade));
+    group.writeEntry("Placement", Placement::policyToString(PlacementZeroCornered));
     group.sync();
     workspace()->slotReconfigure();
 
diff --git a/doc/windowbehaviour/index.docbook b/doc/windowbehaviour/index.docbook
index 5cd88bbcbf..18b5e8ce77 100644
--- a/doc/windowbehaviour/index.docbook
+++ b/doc/windowbehaviour/index.docbook
@@ -1083,15 +1083,6 @@ Will try to maximize all new windows to fill the whole screen.
 </listitem>
 </varlistentry>
 
-<varlistentry>
-<term><guilabel>Cascaded</guilabel></term>
-<listitem>
-<para>
-Will cascade all new windows, opening each one down and to the right of the active window, starting from the top left corner of the screen when no windows are already open.
-</para>
-</listitem>
-</varlistentry>
-
 <varlistentry>
 <term><guilabel>Random</guilabel></term>
 <listitem>
diff --git a/doc/windowspecific/index.docbook b/doc/windowspecific/index.docbook
index 5b9698b6f2..b662744e2b 100644
--- a/doc/windowspecific/index.docbook
+++ b/doc/windowspecific/index.docbook
@@ -340,7 +340,6 @@ and <guibutton>Move Down</guibutton> buttons effects on how they are applied.</p
 <listitem><para><guilabel>No Placement</guilabel> - top-left corner.</para></listitem>
 <listitem><para><guilabel>Minimal Overlapping</guilabel> - place where no other window exists.</para></listitem>
 <listitem><para><guilabel>Maximized</guilabel> - start the window maximized.</para></listitem>
-<listitem><para><guilabel>Cascaded</guilabel> - staircase-by-title.</para></listitem>
 <listitem><para><guilabel>Centered</guilabel> - center of the desktop.</para></listitem>
 <listitem><para><guilabel>Random</guilabel></para></listitem>
 <listitem><para><guilabel>In Top-Left Corner</guilabel></para></listitem>
diff --git a/src/kcmkwin/kwinoptions/advanced.ui b/src/kcmkwin/kwinoptions/advanced.ui
index 98f3ecca34..ecf3afbcbc 100644
--- a/src/kcmkwin/kwinoptions/advanced.ui
+++ b/src/kcmkwin/kwinoptions/advanced.ui
@@ -73,7 +73,7 @@
    <item row="1" column="1">
     <widget class="QComboBox" name="kcfg_Placement">
      <property name="whatsThis">
-      <string><html><head/><body><p>The placement policy determines where a new window will appear on the desktop.</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Smart</span> will try to achieve a minimum overlap of windows</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Maximizing</span> will try to maximize every window to fill the whole screen. It might be useful to selectively affect placement of some windows using the window-specific settings.</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Cascade</span> will cascade the windows</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Random</span> will use a random position</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Centered</span> will place the window centered</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Zero-cornered</span> will place the window in the top-left corner</li><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Under mouse</span> will place the window under the pointer</li></ul></body></html></string>
+      <string><html><head/><body><p>The placement policy determines where a new window will appear on the desktop.</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Smart</span> will try to achieve a minimum overlap of windows</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Maximizing</span> will try to maximize every window to fill the whole screen. It might be useful to selectively affect placement of some windows using the window-specific settings.</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Random</span> will use a random position</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Centered</span> will place the window centered</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Zero-cornered</span> will place the window in the top-left corner</li><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Under mouse</span> will place the window under the pointer</li></ul></body></html></string>
      </property>
      <item>
       <property name="text">
@@ -85,11 +85,6 @@
        <string>Maximized</string>
       </property>
      </item>
-     <item>
-      <property name="text">
-       <string>Cascaded</string>
-      </property>
-     </item>
      <item>
       <property name="text">
        <string>Random</string>
diff --git a/src/kcmkwin/kwinoptions/kwinoptions_settings.kcfg b/src/kcmkwin/kwinoptions/kwinoptions_settings.kcfg
index 2057f94299..bc54b52092 100644
--- a/src/kcmkwin/kwinoptions/kwinoptions_settings.kcfg
+++ b/src/kcmkwin/kwinoptions/kwinoptions_settings.kcfg
@@ -41,7 +41,6 @@
         <choices name="PlacementChoices">
             <choice name="Smart"></choice>
             <choice name="Maximizing"></choice>
-            <choice name="Cascade"></choice>
             <choice name="Random"></choice>
             <choice name="Centered"></choice>
             <choice name="ZeroCornered"></choice>
diff --git a/src/kcmkwin/kwinoptions/windows.cpp b/src/kcmkwin/kwinoptions/windows.cpp
index 2a95ebbc5a..bd03e93758 100644
--- a/src/kcmkwin/kwinoptions/windows.cpp
+++ b/src/kcmkwin/kwinoptions/windows.cpp
@@ -245,7 +245,6 @@ void KAdvancedConfig::initialize(KWinOptionsSettings *settings, KWinOptionsKDEGl
 
     m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Smart, "Smart");
     m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Maximizing, "Maximizing");
-    m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Cascade, "Cascade");
     m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Random, "Random");
     m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Centered, "Centered");
     m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::ZeroCornered, "ZeroCornered");
diff --git a/src/kcmkwin/kwinrules/rulesmodel.cpp b/src/kcmkwin/kwinrules/rulesmodel.cpp
index 96ee645bdc..d59f7c3858 100644
--- a/src/kcmkwin/kwinrules/rulesmodel.cpp
+++ b/src/kcmkwin/kwinrules/rulesmodel.cpp
@@ -793,7 +793,6 @@ QList<OptionsModel::Data> RulesModel::placementModelData() const
         {PlacementNone, i18n("No Placement")},
         {PlacementSmart, i18n("Minimal Overlapping")},
         {PlacementMaximizing, i18n("Maximized")},
-        {PlacementCascade, i18n("Cascaded")},
         {PlacementCentered, i18n("Centered")},
         {PlacementRandom, i18n("Random")},
         {PlacementZeroCornered, i18n("In Top-Left Corner")},
diff --git a/src/kwin.kcfg b/src/kwin.kcfg
index 79998996bd..d30ce1f9d5 100644
--- a/src/kwin.kcfg
+++ b/src/kwin.kcfg
@@ -118,7 +118,6 @@
                 <choice name="PlacementUnknown" value="Unknown"/>
                 <choice name="PlacementRandom" value="Random"/>
                 <choice name="PlacementSmart" value="Smart"/>
-                <choice name="PlacementCascade" value="Cascade"/>
                 <choice name="PlacementCentered" value="Centered"/>
                 <choice name="PlacementZeroCornered" value="ZeroCornered"/>
                 <choice name="PlacementUnderMouse" value="UnderMouse"/>
diff --git a/src/options.h b/src/options.h
index 7040cec0f1..46922566e6 100644
--- a/src/options.h
+++ b/src/options.h
@@ -73,7 +73,6 @@ enum PlacementPolicy {
     PlacementUnknown, // special, means the function should use its default
     PlacementRandom,
     PlacementSmart,
-    PlacementCascade,
     PlacementCentered,
     PlacementZeroCornered,
     PlacementUnderMouse, // special
diff --git a/src/placement.cpp b/src/placement.cpp
index d6c2df1789..723ee558a8 100644
--- a/src/placement.cpp
+++ b/src/placement.cpp
@@ -74,9 +74,6 @@ void Placement::place(Window *c, const QRectF &area, PlacementPolicy policy, Pla
     case PlacementRandom:
         placeAtRandom(c, area.toRect(), nextPlacement);
         break;
-    case PlacementCascade:
-        placeCascaded(c, area.toRect(), nextPlacement);
-        break;
     case PlacementCentered:
         placeCentered(c, area, nextPlacement);
         break;
@@ -661,7 +658,7 @@ void Placement::unclutterDesktop()
 const char *Placement::policyToString(PlacementPolicy policy)
 {
     const char *const policies[] = {
-        "NoPlacement", "Default", "XXX should never see", "Random", "Smart", "Cascade", "Centered",
+        "NoPlacement", "Default", "XXX should never see", "Random", "Smart", "Centered",
         "ZeroCornered", "UnderMouse", "OnMainWindow", "Maximizing"};
     Q_ASSERT(policy < int(sizeof(policies) / sizeof(policies[0])));
     return policies[policy];



More information about the kde-doc-english mailing list