mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 16:05:58 +01:00
parent
d1c80c31c8
commit
4c34e4aac2
2 changed files with 16 additions and 4 deletions
|
@ -691,7 +691,13 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
|
|||
try {
|
||||
if (!m_bIsFloating)
|
||||
return;
|
||||
m_sAdditionalConfigData.maxSize = configStringToVector2D(r.szRule.substr(8));
|
||||
const auto VEC = configStringToVector2D(r.szRule.substr(8));
|
||||
if (VEC.x < 1 || VEC.y < 1) {
|
||||
Debug::log(ERR, "Invalid size for maxsize");
|
||||
return;
|
||||
}
|
||||
|
||||
m_sAdditionalConfigData.maxSize = VEC;
|
||||
m_vRealSize = Vector2D(std::min((double)m_sAdditionalConfigData.maxSize.toUnderlying().x, m_vRealSize.goal().x),
|
||||
std::min((double)m_sAdditionalConfigData.maxSize.toUnderlying().y, m_vRealSize.goal().y));
|
||||
g_pXWaylandManager->setWindowSize(this, m_vRealSize.goal());
|
||||
|
@ -701,7 +707,13 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
|
|||
try {
|
||||
if (!m_bIsFloating)
|
||||
return;
|
||||
m_sAdditionalConfigData.minSize = configStringToVector2D(r.szRule.substr(8));
|
||||
const auto VEC = configStringToVector2D(r.szRule.substr(8));
|
||||
if (VEC.x < 1 || VEC.y < 1) {
|
||||
Debug::log(ERR, "Invalid size for minsize");
|
||||
return;
|
||||
}
|
||||
|
||||
m_sAdditionalConfigData.minSize = VEC;
|
||||
m_vRealSize = Vector2D(std::max((double)m_sAdditionalConfigData.minSize.toUnderlying().x, m_vRealSize.goal().x),
|
||||
std::max((double)m_sAdditionalConfigData.minSize.toUnderlying().y, m_vRealSize.goal().y));
|
||||
g_pXWaylandManager->setWindowSize(this, m_vRealSize.goal());
|
||||
|
@ -722,7 +734,7 @@ void CWindow::updateDynamicRules() {
|
|||
if (!m_sAdditionalConfigData.forceOpaqueOverridden)
|
||||
m_sAdditionalConfigData.forceOpaque = false;
|
||||
m_sAdditionalConfigData.maxSize = Vector2D(std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
|
||||
m_sAdditionalConfigData.minSize = Vector2D(1, 1);
|
||||
m_sAdditionalConfigData.minSize = Vector2D(20, 20);
|
||||
m_sAdditionalConfigData.forceNoAnims = false;
|
||||
m_sAdditionalConfigData.animationStyle = std::string("");
|
||||
m_sAdditionalConfigData.rounding = -1;
|
||||
|
|
|
@ -156,7 +156,7 @@ struct SWindowAdditionalConfigData {
|
|||
CWindowOverridableVar<bool> windowDanceCompat = false;
|
||||
CWindowOverridableVar<bool> noMaxSize = false;
|
||||
CWindowOverridableVar<Vector2D> maxSize = Vector2D(std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
|
||||
CWindowOverridableVar<Vector2D> minSize = Vector2D(1, 1);
|
||||
CWindowOverridableVar<Vector2D> minSize = Vector2D(20, 20);
|
||||
CWindowOverridableVar<bool> dimAround = false;
|
||||
CWindowOverridableVar<bool> forceRGBX = false;
|
||||
CWindowOverridableVar<bool> keepAspectRatio = false;
|
||||
|
|
Loading…
Reference in a new issue