From 81bda675eedd83d16d471a83f1168f7acdb03c24 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 28 Oct 2024 14:25:34 +0000 Subject: [PATCH] all: chase hyprland fixes #237 --- csgo-vulkan-fix/main.cpp | 2 +- hyprbars/barDeco.cpp | 2 +- hyprexpo/overview.cpp | 2 +- hyprwinwrap/main.cpp | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/csgo-vulkan-fix/main.cpp b/csgo-vulkan-fix/main.cpp index d5e6a70..2556a81 100644 --- a/csgo-vulkan-fix/main.cpp +++ b/csgo-vulkan-fix/main.cpp @@ -71,7 +71,7 @@ CRegion hkWLSurfaceDamage(CWLSurface* thisptr) { static auto* const PCLASS = (Hyprlang::STRING const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:csgo-vulkan-fix:class")->getDataStaticPtr(); if (thisptr->exists() && thisptr->getWindow() && thisptr->getWindow()->m_szInitialClass == *PCLASS) { - const auto PMONITOR = g_pCompositor->getMonitorFromID(thisptr->getWindow()->m_iMonitorID); + const auto PMONITOR = thisptr->getWindow()->m_pMonitor.lock(); if (PMONITOR) g_pHyprRenderer->damageMonitor(PMONITOR); else diff --git a/hyprbars/barDeco.cpp b/hyprbars/barDeco.cpp index 1e9e1d3..cd0aaa3 100644 --- a/hyprbars/barDeco.cpp +++ b/hyprbars/barDeco.cpp @@ -9,7 +9,7 @@ CHyprBar::CHyprBar(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) { m_pWindow = pWindow; - const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); + const auto PMONITOR = pWindow->m_pMonitor.lock(); PMONITOR->scheduledRecalc = true; m_pMouseButtonCallback = HyprlandAPI::registerCallbackDynamic( diff --git a/hyprexpo/overview.cpp b/hyprexpo/overview.cpp index 12b7ed1..1cc63e7 100644 --- a/hyprexpo/overview.cpp +++ b/hyprexpo/overview.cpp @@ -76,7 +76,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn auto PWORKSPACESTART = g_pCompositor->getWorkspaceByID(currentID); if (!PWORKSPACESTART) - PWORKSPACESTART = CWorkspace::create(currentID, pMonitor->ID, std::to_string(currentID)); + PWORKSPACESTART = CWorkspace::create(currentID, pMonitor.lock(), std::to_string(currentID)); pMonitor->activeWorkspace = PWORKSPACESTART; diff --git a/hyprwinwrap/main.cpp b/hyprwinwrap/main.cpp index 4d8ed98..4e4bbf0 100644 --- a/hyprwinwrap/main.cpp +++ b/hyprwinwrap/main.cpp @@ -36,7 +36,7 @@ void onNewWindow(PHLWINDOW pWindow) { if (pWindow->m_szInitialClass != *PCLASS) return; - const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); + const auto PMONITOR = pWindow->m_pMonitor.lock(); if (!PMONITOR) return; @@ -73,7 +73,7 @@ void onRenderStage(eRenderStage stage) { for (auto& bg : bgWindows) { const auto bgw = bg.lock(); - if (bgw->m_iMonitorID != g_pHyprOpenGL->m_RenderData.pMonitor->ID) + if (bgw->m_pMonitor != g_pHyprOpenGL->m_RenderData.pMonitor) continue; timespec now; @@ -100,7 +100,7 @@ void onCommitSubsurface(CSubsurface* thisptr) { PWINDOW->m_bHidden = false; ((origCommitSubsurface)subsurfaceHook->m_pOriginal)(thisptr); - if (const auto MON = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); MON) + if (const auto MON = PWINDOW->m_pMonitor.lock(); MON) g_pHyprOpenGL->markBlurDirtyForMonitor(MON); PWINDOW->m_bHidden = true; @@ -118,7 +118,7 @@ void onCommit(void* owner, void* data) { PWINDOW->m_bHidden = false; ((origCommit)commitHook->m_pOriginal)(owner, data); - if (const auto MON = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); MON) + if (const auto MON = PWINDOW->m_pMonitor.lock(); MON) g_pHyprOpenGL->markBlurDirtyForMonitor(MON); PWINDOW->m_bHidden = true;