From d4d5e3b7a896a69b7f8c02cd3b836fc643cd2d9a Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Mon, 23 May 2022 23:25:45 +0200 Subject: [PATCH] kcm/rules: Improve "Ignore Geometry" property UI This property is not used on Wayland because windows are already not allowed to set their own geometry, so let's hide it from the UI. Also update the tooltip to explicitly state which properties the `Ignore Geometry` property does affect on X11 BUG: 431265 FIXED-IN: 6.0 --- src/kcms/rules/rulesmodel.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/kcms/rules/rulesmodel.cpp b/src/kcms/rules/rulesmodel.cpp index 76191a326f..9efd466479 100644 --- a/src/kcms/rules/rulesmodel.cpp +++ b/src/kcms/rules/rulesmodel.cpp @@ -268,6 +268,10 @@ bool RulesModel::wmclassWarning() const bool RulesModel::geometryWarning() const { + if (!KWindowSystem::isPlatformX11()) { + return false; + } + const bool ignoregeometry = m_rules["ignoregeometry"]->isEnabled() && m_rules["ignoregeometry"]->policy() == Rules::Force && m_rules["ignoregeometry"]->value() == true; @@ -520,15 +524,20 @@ void RulesModel::populateRuleList() placement->setOptionsData(placementModelData()); placement->setFlag(RuleItem::AffectsWarning); - auto ignoregeometry = addRule(new RuleItem(QLatin1String("ignoregeometry"), - RulePolicy::SetRule, RuleItem::Boolean, - i18n("Ignore requested geometry"), i18n("Size & Position"), - QIcon::fromTheme("view-time-schedule-baselined-remove"), - i18n("Windows can ask to appear in a certain position. " - "By default this overrides the placement strategy " - "what might be nasty if the client abuses the feature " - "to unconditionally popup in the middle of your screen."))); - ignoregeometry->setFlag(RuleItem::AffectsWarning); + if (KWindowSystem::isPlatformX11()) { + // On Wayland windows cannot set their own geometry + auto ignoregeometry = addRule(new RuleItem(QLatin1String("ignoregeometry"), + RulePolicy::SetRule, RuleItem::Boolean, + i18n("Ignore requested geometry"), i18n("Size & Position"), + QIcon::fromTheme("view-time-schedule-baselined-remove"), + xi18nc("@info:tooltip", + "Some applications can set their own geometry, overriding the window manager preferences. " + "Setting this property overrides their placement requests." + "This affects Size and Position " + "but not Maximized or Fullscreen states." + "Note that the position can also be used to map to a different Screen"))); + ignoregeometry->setFlag(RuleItem::AffectsWarning); + } addRule(new RuleItem(QLatin1String("minsize"), RulePolicy::ForceRule, RuleItem::Size,