From 56f71160f85b9f1b48a8c95e3f20f08be3b68eea Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 2 Mar 2024 17:06:08 +0000 Subject: [PATCH] csgo-vk-fix: damage monitor if available --- csgo-vulkan-fix/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/csgo-vulkan-fix/main.cpp b/csgo-vulkan-fix/main.cpp index 1a21382..838ed66 100644 --- a/csgo-vulkan-fix/main.cpp +++ b/csgo-vulkan-fix/main.cpp @@ -65,8 +65,13 @@ void hkSurfaceDamage(wlr_surface* surface, pixman_region32_t* damage) { const auto SURF = CWLSurface::surfaceFromWlr(surface); - if (SURF && SURF->exists() && SURF->getWindow() && SURF->getWindow()->m_szInitialClass == *PCLASS) - g_pHyprRenderer->damageWindow(SURF->getWindow()); + if (SURF && SURF->exists() && SURF->getWindow() && SURF->getWindow()->m_szInitialClass == *PCLASS) { + const auto PMONITOR = g_pCompositor->getMonitorFromID(SURF->getWindow()->m_iMonitorID); + if (PMONITOR) + g_pHyprRenderer->damageMonitor(PMONITOR); + else + g_pHyprRenderer->damageWindow(SURF->getWindow()); + } } APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {