aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-03-09 15:32:36 +0000
committerVaxry <[email protected]>2024-03-09 15:32:36 +0000
commitc9ea600baa186acd3825dde306a6b3f89de09131 (patch)
tree1617161bdf3b8d415bbff71f58abdff9b06710cb
parent3e930a568a76a810dde6bcabcf737a81850e7153 (diff)
downloadHyprland-c9ea600baa186acd3825dde306a6b3f89de09131.tar.gz
Hyprland-c9ea600baa186acd3825dde306a6b3f89de09131.zip
layer-shell: allow for popup creation before map
ref https://github.com/jjsullivan5196/wvkbd/issues/65
-rw-r--r--src/events/Layers.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index ad65f8fb..db237690 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -51,6 +51,7 @@ void Events::listener_newLayerSurface(wl_listener* listener, void* data) {
layerSurface->layer = WLRLAYERSURFACE->current.layer;
WLRLAYERSURFACE->data = layerSurface;
layerSurface->monitorID = PMONITOR->ID;
+ layerSurface->popupHead = std::make_unique<CPopup>(layerSurface);
layerSurface->forceBlur = g_pConfigManager->shouldBlurLS(layerSurface->szNamespace);
@@ -65,6 +66,8 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(layersurface->monitorID);
+ layersurface->popupHead.reset();
+
if (!g_pCompositor->getMonitorFromID(layersurface->monitorID))
Debug::log(WARN, "Layersurface destroyed on an invalid monitor (removed?)");
@@ -111,8 +114,6 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
layersurface->keyboardExclusive = layersurface->layerSurface->current.keyboard_interactive;
layersurface->surface = layersurface->layerSurface->surface;
- layersurface->popupHead = std::make_unique<CPopup>(layersurface);
-
// fix if it changed its mon
const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output);
@@ -184,8 +185,6 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) {
std::erase(g_pInputManager->m_dExclusiveLSes, layersurface);
- layersurface->popupHead.reset();
-
if (!g_pInputManager->m_dExclusiveLSes.empty())
g_pCompositor->focusSurface(g_pInputManager->m_dExclusiveLSes[0]->layerSurface->surface);