diff options
author | vaxerski <[email protected]> | 2023-10-06 14:00:05 +0100 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-10-06 14:00:05 +0100 |
commit | cb7dd1ac6ef250dc25b8e86b744dd47a24f12971 (patch) | |
tree | e495cd7e36245b62553a9929cafd474944aa6f01 | |
parent | 4b3efc73c5d059e828f79952d80ff79c97521c3d (diff) | |
download | Hyprland-cb7dd1ac6ef250dc25b8e86b744dd47a24f12971.tar.gz Hyprland-cb7dd1ac6ef250dc25b8e86b744dd47a24f12971.zip |
layershell: avoid configure on unchanged size
fixes #3496
-rw-r--r-- | src/render/Renderer.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index a685f735..efdf3ce6 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1274,18 +1274,18 @@ void CHyprRenderer::arrangeLayerArray(CMonitor* pMonitor, const std::vector<std: const auto PLAYER = ls->layerSurface; const auto PSTATE = &PLAYER->current; - if (exclusiveZone != (PSTATE->exclusive_zone > 0)) { + if (exclusiveZone != (PSTATE->exclusive_zone > 0)) continue; - } wlr_box bounds; - if (PSTATE->exclusive_zone == -1) { + if (PSTATE->exclusive_zone == -1) bounds = full_area; - } else { + else bounds = *usableArea; - } - wlr_box box = {.width = PSTATE->desired_width, .height = PSTATE->desired_height}; + const Vector2D OLDSIZE = {ls->geometry.width, ls->geometry.height}; + + wlr_box box = {.width = PSTATE->desired_width, .height = PSTATE->desired_height}; // Horizontal axis const uint32_t both_horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; if (box.width == 0) { @@ -1342,7 +1342,8 @@ void CHyprRenderer::arrangeLayerArray(CMonitor* pMonitor, const std::vector<std: apply_exclusive(usableArea, PSTATE->anchor, PSTATE->exclusive_zone, PSTATE->margin.top, PSTATE->margin.right, PSTATE->margin.bottom, PSTATE->margin.left); - wlr_layer_surface_v1_configure(ls->layerSurface, box.width, box.height); + if (Vector2D{box.width, box.height} != OLDSIZE) + wlr_layer_surface_v1_configure(ls->layerSurface, box.width, box.height); Debug::log(LOG, "LayerSurface {:x} arranged: x: {} y: {} w: {} h: {} with margins: t: {} l: {} r: {} b: {}", (uintptr_t)&ls, box.x, box.y, box.width, box.height, PSTATE->margin.top, PSTATE->margin.left, PSTATE->margin.right, PSTATE->margin.bottom); |