mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 05:29:48 +01:00
Fix certain layersurfaces crashing
This commit is contained in:
parent
deb18af955
commit
cba4693d39
2 changed files with 18 additions and 1 deletions
|
@ -58,6 +58,23 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) {
|
|||
|
||||
Debug::log(LOG, "LayerSurface %x destroyed", layersurface->layerSurface);
|
||||
|
||||
if (!layersurface->fadingOut) {
|
||||
if (layersurface->layerSurface->mapped) {
|
||||
Debug::log(LOG, "LayerSurface wasn't unmapped, making a snapshot now!");
|
||||
|
||||
// make a snapshot and start fade
|
||||
// layersurfaces aren't required to unmap before destroy
|
||||
g_pHyprOpenGL->makeLayerSnapshot(layersurface);
|
||||
layersurface->alpha = 0.f;
|
||||
|
||||
layersurface->fadingOut = true;
|
||||
} else {
|
||||
Debug::log(LOG, "Removing LayerSurface that wasn't mapped.");
|
||||
layersurface->alpha.setValueAndWarp(0.f);
|
||||
layersurface->fadingOut = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (layersurface->layerSurface->mapped)
|
||||
layersurface->layerSurface->mapped = false;
|
||||
|
||||
|
|
|
@ -322,7 +322,7 @@ void CHyprRenderer::arrangeLayerArray(SMonitor* pMonitor, const std::list<SLayer
|
|||
wlr_box full_area = {pMonitor->vecPosition.x, pMonitor->vecPosition.y, pMonitor->vecSize.x, pMonitor->vecSize.y};
|
||||
|
||||
for (auto& ls : layerSurfaces) {
|
||||
if (ls->fadingOut)
|
||||
if (ls->fadingOut || ls->readyToDelete)
|
||||
continue;
|
||||
|
||||
const auto PLAYER = ls->layerSurface;
|
||||
|
|
Loading…
Reference in a new issue