config: improve config value infrastructure

This commit is contained in:
Vaxry
2024-03-03 18:39:20 +00:00
parent 8ccbd272cc
commit 063708df26
28 changed files with 794 additions and 697 deletions

View File

@@ -1,5 +1,6 @@
#include "XDGOutput.hpp"
#include "../Compositor.hpp"
#include "../config/ConfigValue.hpp"
#include "xdg-output-unstable-v1-protocol.h"
@@ -112,7 +113,7 @@ void CXDGOutputProtocol::onManagerGetXDGOutput(wl_client* client, wl_resource* r
}
void CXDGOutputProtocol::updateOutputDetails(SXDGOutput* pOutput) {
static auto* const PXWLFORCESCALEZERO = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling");
static auto PXWLFORCESCALEZERO = CConfigValue<Hyprlang::INT>("xwayland:force_zero_scaling");
if (!pOutput->resource->good() || !pOutput->monitor)
return;
@@ -120,7 +121,7 @@ void CXDGOutputProtocol::updateOutputDetails(SXDGOutput* pOutput) {
const auto POS = pOutput->isXWayland ? pOutput->monitor->vecXWaylandPosition : pOutput->monitor->vecPosition;
zxdg_output_v1_send_logical_position(pOutput->resource->resource(), POS.x, POS.y);
if (**PXWLFORCESCALEZERO && pOutput->isXWayland)
if (*PXWLFORCESCALEZERO && pOutput->isXWayland)
zxdg_output_v1_send_logical_size(pOutput->resource->resource(), pOutput->monitor->vecTransformedSize.x, pOutput->monitor->vecTransformedSize.y);
else
zxdg_output_v1_send_logical_size(pOutput->resource->resource(), pOutput->monitor->vecSize.x, pOutput->monitor->vecSize.y);