summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-26 18:22:34 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-26 18:22:34 +0200
commitb18a2738e3d9a46be0ea896711f28d7cad61da85 (patch)
tree7c377c4b05daa61f8877b64600373e10e9184b78 /src
parent99ebbb36b24f7f25d37355d26a1044a0299a2256 (diff)
schedule recalcs in LS
Diffstat (limited to 'src')
-rw-r--r--src/events/Layers.cpp8
-rw-r--r--src/events/Monitors.cpp5
-rw-r--r--src/helpers/Monitor.hpp1
3 files changed, 10 insertions, 4 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index cc5d935f..49b626a0 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -89,7 +89,7 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) {
// rearrange to fix the reserved areas
if (PMONITOR) {
g_pHyprRenderer->arrangeLayersForMonitor(PMONITOR->ID);
- g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITOR->ID);
+ PMONITOR->scheduledRecalc = true;
// and damage
wlr_box geomFixed = {layersurface->geometry.x + PMONITOR->vecPosition.x, layersurface->geometry.y + PMONITOR->vecPosition.y, layersurface->geometry.width, layersurface->geometry.height};
@@ -124,7 +124,7 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
}
}
layersurface->monitorID = PMONITOR->ID;
- g_pLayoutManager->getCurrentLayout()->recalculateMonitor(POLDMON->ID);
+ PMONITOR->scheduledRecalc = true;
g_pHyprRenderer->arrangeLayersForMonitor(POLDMON->ID);
}
@@ -229,7 +229,7 @@ void Events::listener_commitLayerSurface(void* owner, void* data) {
}
layersurface->monitorID = PMONITOR->ID;
- g_pLayoutManager->getCurrentLayout()->recalculateMonitor(POLDMON->ID);
+ PMONITOR->scheduledRecalc = true;
g_pHyprRenderer->arrangeLayersForMonitor(POLDMON->ID);
}
@@ -249,7 +249,7 @@ void Events::listener_commitLayerSurface(void* owner, void* data) {
g_pHyprRenderer->arrangeLayersForMonitor(PMONITOR->ID);
- g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITOR->ID);
+ PMONITOR->scheduledRecalc = true;
}
layersurface->position = Vector2D(layersurface->geometry.x, layersurface->geometry.y);
diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp
index 57da68fc..44bba5d6 100644
--- a/src/events/Monitors.cpp
+++ b/src/events/Monitors.cpp
@@ -214,6 +214,11 @@ void Events::listener_monitorFrame(void* owner, void* data) {
}
// //
+ if (PMONITOR->scheduledRecalc) {
+ PMONITOR->scheduledRecalc = false;
+ g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITOR->ID);
+ }
+
timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp
index 93736614..0112aab5 100644
--- a/src/helpers/Monitor.hpp
+++ b/src/helpers/Monitor.hpp
@@ -31,6 +31,7 @@ struct SMonitor {
int framesToSkip = 0;
int forceFullFrames = 0;
bool noFrameSchedule = false;
+ bool scheduledRecalc = false;
wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL;
// for the special workspace