mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 11:26:00 +01:00
layer-shell: allow for popup creation before map
ref https://github.com/jjsullivan5196/wvkbd/issues/65
This commit is contained in:
parent
3e930a568a
commit
c9ea600baa
1 changed files with 3 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue