fixed closing layers not recalcing layout

This commit is contained in:
vaxerski 2022-03-21 16:33:38 +01:00
parent cd720eaf66
commit 21418f97ff
2 changed files with 11 additions and 3 deletions

View file

@ -31,7 +31,6 @@ Nevertheless, REPORT any you find! Make an issue!
- Window rules
- Drag and drop
- Fix electron rendering issues
- Fix closing layers not recalcing layout
- Fix sloppy dragging of windows
- Optimization
- IPC done correctly with a socket

View file

@ -57,7 +57,7 @@ void Events::listener_destroyLayerSurface(wl_listener* listener, void* data) {
SLayerSurface* layersurface = wl_container_of(listener, layersurface, listen_destroyLayerSurface);
if (layersurface->layerSurface->mapped)
layersurface->layerSurface->mapped = 0;
layersurface->layerSurface->mapped = false;
if (layersurface->layerSurface->surface == g_pCompositor->m_pLastFocus)
g_pCompositor->m_pLastFocus = nullptr;
@ -73,12 +73,21 @@ void Events::listener_destroyLayerSurface(wl_listener* listener, void* data) {
PMONITOR->m_aLayerSurfaceLists[layersurface->layer].remove(layersurface);
delete layersurface;
// rearrange to fix the reserved areas
if (PMONITOR) {
g_pHyprRenderer->arrangeLayersForMonitor(PMONITOR->ID);
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITOR->ID);
}
Debug::log(LOG, "LayerSurface %x destroyed", layersurface);
}
void Events::listener_mapLayerSurface(wl_listener* listener, void* data) {
SLayerSurface* layersurface = wl_container_of(listener, layersurface, listen_mapLayerSurface);
layersurface->layerSurface->mapped = true;
wlr_surface_send_enter(layersurface->layerSurface->surface, layersurface->layerSurface->output);
// fix if it changed its mon
@ -105,7 +114,7 @@ void Events::listener_unmapLayerSurface(wl_listener* listener, void* data) {
SLayerSurface* layersurface = wl_container_of(listener, layersurface, listen_unmapLayerSurface);
if (layersurface->layerSurface->mapped)
layersurface->layerSurface->mapped = 0;
layersurface->layerSurface->mapped = false;
if (layersurface->layerSurface->surface == g_pCompositor->m_pLastFocus)
g_pCompositor->m_pLastFocus = nullptr;