summaryrefslogtreecommitdiff
path: root/src/layout/IHyprLayout.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-02-18 15:00:34 +0000
committerGitHub <noreply@github.com>2024-02-18 15:00:34 +0000
commit13f6f0b923ff3ec94a3bec886c28b90402ceef91 (patch)
tree251f66bfb86416fad0fab18f3b2b2ce87847aa83 /src/layout/IHyprLayout.cpp
parent7e8bcd675de15ee2498f1aa15c5b335e9a9a55f0 (diff)
Migrate the config to hyprlang (#4656)
* Migrate to hyprlang * pop up errors * fix swapped args * Meson & Nix: build with hyprlang * CI: add hyprlang to setup action * add infra for plugin stuff * fix hyprctl getoption * fix hyprctl getoption with json * format * fix post parse logic * fix autogen config * oops missed exec-once * fmt * fix ws rules * require 0.3.0 for hyprlang * nix: flaek * minor type fixes * fix cfg usages in swipe * use cvarlist for ws rules * fix throw in addPluginConfigVar * Nix: update hyprlang * minor fixes * fix disableLogs * mention hyprlang docs * bump hyprlang dep in cmake * Meson: bump min hyprlang version Nix: update hyprlang * minor fix * Nix: update meson patch --------- Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
-rw-r--r--src/layout/IHyprLayout.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp
index ee692178..49e20435 100644
--- a/src/layout/IHyprLayout.cpp
+++ b/src/layout/IHyprLayout.cpp
@@ -87,7 +87,7 @@ void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) {
desiredGeometry.y = xy.y;
}
- static auto* const PXWLFORCESCALEZERO = &g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling")->intValue;
+ static auto* const PXWLFORCESCALEZERO = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling");
if (!PMONITOR) {
Debug::log(ERR, "{:m} has an invalid monitor in onWindowCreatedFloating!!!", pWindow);
@@ -151,7 +151,7 @@ void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) {
}
}
- if (*PXWLFORCESCALEZERO && pWindow->m_bIsX11)
+ if (**PXWLFORCESCALEZERO && pWindow->m_bIsX11)
pWindow->m_vRealSize = pWindow->m_vRealSize.goalv() / PMONITOR->scale;
if (pWindow->m_bX11DoesntWantBorders || (pWindow->m_bIsX11 && pWindow->m_uSurface.xwayland->override_redirect)) {
@@ -275,8 +275,8 @@ void IHyprLayout::onEndDragWindow() {
return;
if (pWindow->m_sGroupData.pNextWindow && DRAGGINGWINDOW->canBeGroupedInto(pWindow)) {
- static const auto* USECURRPOS = &g_pConfigManager->getConfigValuePtr("group:insert_after_current")->intValue;
- (*USECURRPOS ? pWindow : pWindow->getGroupTail())->insertWindowToGroup(DRAGGINGWINDOW);
+ static const auto* USECURRPOS = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("group:insert_after_current");
+ (**USECURRPOS ? pWindow : pWindow->getGroupTail())->insertWindowToGroup(DRAGGINGWINDOW);
pWindow->setGroupCurrent(DRAGGINGWINDOW);
DRAGGINGWINDOW->updateWindowDecos();
@@ -309,8 +309,8 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
const auto DELTA = Vector2D(mousePos.x - m_vBeginDragXY.x, mousePos.y - m_vBeginDragXY.y);
const auto TICKDELTA = Vector2D(mousePos.x - m_vLastDragXY.x, mousePos.y - m_vLastDragXY.y);
- static auto* const PANIMATEMOUSE = &g_pConfigManager->getConfigValuePtr("misc:animate_mouse_windowdragging")->intValue;
- static auto* const PANIMATE = &g_pConfigManager->getConfigValuePtr("misc:animate_manual_resizes")->intValue;
+ static auto* const PANIMATEMOUSE = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("misc:animate_mouse_windowdragging");
+ static auto* const PANIMATE = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("misc:animate_manual_resizes");
if ((abs(TICKDELTA.x) < 1.f && abs(TICKDELTA.y) < 1.f) ||
(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - TIMER).count() <
@@ -328,7 +328,7 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
CBox wb = {m_vBeginDragPositionXY + DELTA, DRAGGINGWINDOW->m_vRealSize.goalv()};
wb.round();
- if (*PANIMATEMOUSE)
+ if (**PANIMATEMOUSE)
DRAGGINGWINDOW->m_vRealPosition = wb.pos();
else
DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(wb.pos());
@@ -386,7 +386,7 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
CBox wb = {newPos, newSize};
wb.round();
- if (*PANIMATE) {
+ if (**PANIMATE) {
DRAGGINGWINDOW->m_vRealSize = wb.size();
DRAGGINGWINDOW->m_vRealPosition = wb.pos();
} else {