mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 02:30:03 +01:00
desktop/windowRule: force center and move rules to override each other (#12618)
This commit is contained in:
parent
7098558420
commit
18901b8e59
3 changed files with 4 additions and 2 deletions
|
|
@ -481,6 +481,7 @@ CWindowRuleApplicator::SRuleResult CWindowRuleApplicator::applyStaticRule(const
|
|||
break;
|
||||
}
|
||||
case WINDOW_RULE_EFFECT_MOVE: {
|
||||
static_.center = std::nullopt;
|
||||
static_.position = effect;
|
||||
break;
|
||||
}
|
||||
|
|
@ -489,6 +490,7 @@ CWindowRuleApplicator::SRuleResult CWindowRuleApplicator::applyStaticRule(const
|
|||
break;
|
||||
}
|
||||
case WINDOW_RULE_EFFECT_CENTER: {
|
||||
static_.position.clear();
|
||||
static_.center = truthy(effect);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ namespace Desktop::Rule {
|
|||
std::optional<bool> pseudo;
|
||||
std::optional<bool> pin;
|
||||
std::optional<bool> noInitialFocus;
|
||||
std::optional<bool> center;
|
||||
|
||||
std::optional<int> fullscreenStateClient;
|
||||
std::optional<int> fullscreenStateInternal;
|
||||
std::optional<int> center;
|
||||
std::optional<int> content;
|
||||
std::optional<int> noCloseFor;
|
||||
|
||||
|
|
|
|||
|
|
@ -2248,7 +2248,7 @@ void CWindow::mapWindow() {
|
|||
}
|
||||
}
|
||||
|
||||
if (m_ruleApplicator->static_.center) {
|
||||
if (m_ruleApplicator->static_.center.value_or(false)) {
|
||||
const auto WORKAREA = PMONITOR->logicalBoxMinusReserved();
|
||||
*m_realPosition = WORKAREA.middle() - m_realSize->goal() / 2.f;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue