dwindle: fix single_window_aspect_ratio not updating with config reload (#11305)

* dwindle: fix single_window_aspect_ratio not updating with config reload

* refactor: dereference instead of using ptr method
This commit is contained in:
Rico 2025-08-02 15:24:18 +02:00 committed by GitHub
parent e1e23eb9bd
commit f1f1161c17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,15 +155,15 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
auto calcPos = PWINDOW->m_position;
auto calcSize = PWINDOW->m_size;
const static auto REQUESTEDRATIO = *CConfigValue<Hyprlang::VEC2>("dwindle:single_window_aspect_ratio");
const static auto REQUESTEDRATIO = CConfigValue<Hyprlang::VEC2>("dwindle:single_window_aspect_ratio");
const static auto REQUESTEDRATIOTOLERANCE = CConfigValue<Hyprlang::FLOAT>("dwindle:single_window_aspect_ratio_tolerance");
Vector2D ratioPadding;
if (REQUESTEDRATIO.y != 0 && !pNode->pParent) {
if ((*REQUESTEDRATIO).y != 0 && !pNode->pParent) {
const Vector2D originalSize = PMONITOR->m_size - PMONITOR->m_reservedTopLeft - PMONITOR->m_reservedBottomRight;
const double requestedRatio = REQUESTEDRATIO.x / REQUESTEDRATIO.y;
const double requestedRatio = (*REQUESTEDRATIO).x / (*REQUESTEDRATIO).y;
const double originalRatio = originalSize.x / originalSize.y;
if (requestedRatio > originalRatio) {