placement: remove cascaded placement policy
becomes redundant with cascade-if-covering for zero-cornered placement
This commit is contained in:
parent
b08ef54727
commit
b6412454c2
10 changed files with 6 additions and 47 deletions
|
@ -43,12 +43,11 @@ private Q_SLOTS:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
|
|
||||||
void testPlaceSmart();
|
void testPlaceSmart();
|
||||||
void testPlaceZeroCornered();
|
|
||||||
void testPlaceMaximized();
|
void testPlaceMaximized();
|
||||||
void testPlaceMaximizedLeavesFullscreen();
|
void testPlaceMaximizedLeavesFullscreen();
|
||||||
void testPlaceCentered();
|
void testPlaceCentered();
|
||||||
void testPlaceUnderMouse();
|
void testPlaceUnderMouse();
|
||||||
void testPlaceCascaded();
|
void testPlaceZeroCornered();
|
||||||
void testPlaceRandom();
|
void testPlaceRandom();
|
||||||
void testFullscreen();
|
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()
|
void TestPlacement::testPlaceMaximized()
|
||||||
{
|
{
|
||||||
setPlacementPolicy(PlacementMaximizing);
|
setPlacementPolicy(PlacementMaximizing);
|
||||||
|
@ -271,12 +253,12 @@ void TestPlacement::testPlaceUnderMouse()
|
||||||
QVERIFY(Test::waitForWindowDestroyed(window));
|
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");
|
KConfigGroup group = kwinApp()->config()->group("Windows");
|
||||||
group.writeEntry("Placement", Placement::policyToString(PlacementCascade));
|
group.writeEntry("Placement", Placement::policyToString(PlacementZeroCornered));
|
||||||
group.sync();
|
group.sync();
|
||||||
workspace()->slotReconfigure();
|
workspace()->slotReconfigure();
|
||||||
|
|
||||||
|
|
|
@ -1083,15 +1083,6 @@ Will try to maximize all new windows to fill the whole screen.
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</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>
|
<varlistentry>
|
||||||
<term><guilabel>Random</guilabel></term>
|
<term><guilabel>Random</guilabel></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
|
@ -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>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>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>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>Centered</guilabel> - center of the desktop.</para></listitem>
|
||||||
<listitem><para><guilabel>Random</guilabel></para></listitem>
|
<listitem><para><guilabel>Random</guilabel></para></listitem>
|
||||||
<listitem><para><guilabel>In Top-Left Corner</guilabel></para></listitem>
|
<listitem><para><guilabel>In Top-Left Corner</guilabel></para></listitem>
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="kcfg_Placement">
|
<widget class="QComboBox" name="kcfg_Placement">
|
||||||
<property name="whatsThis">
|
<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>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -85,11 +85,6 @@
|
||||||
<string>Maximized</string>
|
<string>Maximized</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Cascaded</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Random</string>
|
<string>Random</string>
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
<choices name="PlacementChoices">
|
<choices name="PlacementChoices">
|
||||||
<choice name="Smart"></choice>
|
<choice name="Smart"></choice>
|
||||||
<choice name="Maximizing"></choice>
|
<choice name="Maximizing"></choice>
|
||||||
<choice name="Cascade"></choice>
|
|
||||||
<choice name="Random"></choice>
|
<choice name="Random"></choice>
|
||||||
<choice name="Centered"></choice>
|
<choice name="Centered"></choice>
|
||||||
<choice name="ZeroCornered"></choice>
|
<choice name="ZeroCornered"></choice>
|
||||||
|
|
|
@ -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::Smart, "Smart");
|
||||||
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Maximizing, "Maximizing");
|
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::Random, "Random");
|
||||||
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Centered, "Centered");
|
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Centered, "Centered");
|
||||||
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::ZeroCornered, "ZeroCornered");
|
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::ZeroCornered, "ZeroCornered");
|
||||||
|
|
|
@ -793,7 +793,6 @@ QList<OptionsModel::Data> RulesModel::placementModelData() const
|
||||||
{PlacementNone, i18n("No Placement")},
|
{PlacementNone, i18n("No Placement")},
|
||||||
{PlacementSmart, i18n("Minimal Overlapping")},
|
{PlacementSmart, i18n("Minimal Overlapping")},
|
||||||
{PlacementMaximizing, i18n("Maximized")},
|
{PlacementMaximizing, i18n("Maximized")},
|
||||||
{PlacementCascade, i18n("Cascaded")},
|
|
||||||
{PlacementCentered, i18n("Centered")},
|
{PlacementCentered, i18n("Centered")},
|
||||||
{PlacementRandom, i18n("Random")},
|
{PlacementRandom, i18n("Random")},
|
||||||
{PlacementZeroCornered, i18n("In Top-Left Corner")},
|
{PlacementZeroCornered, i18n("In Top-Left Corner")},
|
||||||
|
|
|
@ -118,7 +118,6 @@
|
||||||
<choice name="PlacementUnknown" value="Unknown"/>
|
<choice name="PlacementUnknown" value="Unknown"/>
|
||||||
<choice name="PlacementRandom" value="Random"/>
|
<choice name="PlacementRandom" value="Random"/>
|
||||||
<choice name="PlacementSmart" value="Smart"/>
|
<choice name="PlacementSmart" value="Smart"/>
|
||||||
<choice name="PlacementCascade" value="Cascade"/>
|
|
||||||
<choice name="PlacementCentered" value="Centered"/>
|
<choice name="PlacementCentered" value="Centered"/>
|
||||||
<choice name="PlacementZeroCornered" value="ZeroCornered"/>
|
<choice name="PlacementZeroCornered" value="ZeroCornered"/>
|
||||||
<choice name="PlacementUnderMouse" value="UnderMouse"/>
|
<choice name="PlacementUnderMouse" value="UnderMouse"/>
|
||||||
|
|
|
@ -73,7 +73,6 @@ enum PlacementPolicy {
|
||||||
PlacementUnknown, // special, means the function should use its default
|
PlacementUnknown, // special, means the function should use its default
|
||||||
PlacementRandom,
|
PlacementRandom,
|
||||||
PlacementSmart,
|
PlacementSmart,
|
||||||
PlacementCascade,
|
|
||||||
PlacementCentered,
|
PlacementCentered,
|
||||||
PlacementZeroCornered,
|
PlacementZeroCornered,
|
||||||
PlacementUnderMouse, // special
|
PlacementUnderMouse, // special
|
||||||
|
|
|
@ -74,9 +74,6 @@ void Placement::place(Window *c, const QRectF &area, PlacementPolicy policy, Pla
|
||||||
case PlacementRandom:
|
case PlacementRandom:
|
||||||
placeAtRandom(c, area.toRect(), nextPlacement);
|
placeAtRandom(c, area.toRect(), nextPlacement);
|
||||||
break;
|
break;
|
||||||
case PlacementCascade:
|
|
||||||
placeCascaded(c, area.toRect(), nextPlacement);
|
|
||||||
break;
|
|
||||||
case PlacementCentered:
|
case PlacementCentered:
|
||||||
placeCentered(c, area, nextPlacement);
|
placeCentered(c, area, nextPlacement);
|
||||||
break;
|
break;
|
||||||
|
@ -661,7 +658,7 @@ void Placement::unclutterDesktop()
|
||||||
const char *Placement::policyToString(PlacementPolicy policy)
|
const char *Placement::policyToString(PlacementPolicy policy)
|
||||||
{
|
{
|
||||||
const char *const policies[] = {
|
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"};
|
"ZeroCornered", "UnderMouse", "OnMainWindow", "Maximizing"};
|
||||||
Q_ASSERT(policy < int(sizeof(policies) / sizeof(policies[0])));
|
Q_ASSERT(policy < int(sizeof(policies) / sizeof(policies[0])));
|
||||||
return policies[policy];
|
return policies[policy];
|
||||||
|
|
Loading…
Reference in a new issue