summaryrefslogtreecommitdiff
path: root/src/events/Layers.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2023-03-20 15:00:58 +0000
committerGitHub <noreply@github.com>2023-03-20 15:00:58 +0000
commit788a8f7c134a34085d683e44a328e344be6b21f3 (patch)
treebed90c82b3c3e65722b5f1f97a6d04240ad3c7fc /src/events/Layers.cpp
parentd23bbd1687a5413fb7f2c08b67692d4e64f8efef (diff)
internal: wrap wlr surfaces (#1822)
Diffstat (limited to 'src/events/Layers.cpp')
-rw-r--r--src/events/Layers.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index 28c80e1d..a7135953 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -112,6 +112,8 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
layersurface->layerSurface->mapped = true;
layersurface->mapped = true;
+ layersurface->surface = layersurface->layerSurface->surface;
+
// anim
layersurface->alpha.setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeIn"));
@@ -207,12 +209,15 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) {
const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output);
+ const bool WASLASTFOCUS = g_pCompositor->m_pLastFocus == layersurface->layerSurface->surface;
+
+ layersurface->surface = nullptr;
+
if (!PMONITOR)
return;
// refocus if needed
- if (layersurface->layerSurface->surface == g_pCompositor->m_pLastFocus) {
-
+ if (WASLASTFOCUS) {
Vector2D surfaceCoords;
SLayerSurface* pFoundLayerSurface = nullptr;
wlr_surface* foundSurface = nullptr;