aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorIkalco <[email protected]>2024-06-12 12:28:52 -0500
committerGitHub <[email protected]>2024-06-12 19:28:52 +0200
commit38132ffaf53c843a3ed03be5b305702fde8f5a49 (patch)
tree9b5662659d647e6221dd3cf4b43b417e7f744b76 /src/render/Renderer.cpp
parenta99f314106cd2ae45e12e7c4012ab68026cf5522 (diff)
downloadHyprland-38132ffaf53c843a3ed03be5b305702fde8f5a49.tar.gz
Hyprland-38132ffaf53c843a3ed03be5b305702fde8f5a49.zip
renderer: properly software lock cursors with zoom_factor (#6434)
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 8fac5869..48fa92a0 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1253,6 +1253,15 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
TRACY_GPU_ZONE("Render");
+ static bool zoomLock = false;
+ if (zoomLock && *PZOOMFACTOR == 1.f) {
+ g_pPointerManager->unlockSoftwareAll();
+ zoomLock = false;
+ } else if (!zoomLock && *PZOOMFACTOR != 1.f) {
+ g_pPointerManager->lockSoftwareAll();
+ zoomLock = true;
+ }
+
if (pMonitor == g_pCompositor->getMonitorFromCursor())
g_pHyprOpenGL->m_RenderData.mouseZoomFactor = std::clamp(*PZOOMFACTOR, 1.f, INFINITY);
else
@@ -1265,10 +1274,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
pMonitor->forceFullFrames = 10;
}
- bool lockSoftware = pMonitor == g_pCompositor->getMonitorFromCursor() && *PZOOMFACTOR != 1.f;
- if (lockSoftware)
- g_pPointerManager->lockSoftwareForMonitor(pMonitor->self.lock());
-
CRegion damage, finalDamage;
if (!beginRender(pMonitor, damage, RENDER_MODE_NORMAL)) {
Debug::log(ERR, "renderer: couldn't beginRender()!");
@@ -1370,9 +1375,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
endRender();
- if (lockSoftware)
- g_pPointerManager->unlockSoftwareForMonitor(pMonitor->self.lock());
-
TRACY_GPU_COLLECT;
if (!pMonitor->mirrors.empty()) {