mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-27 03:05:59 +01:00
force unmap on direct destroy
This commit is contained in:
parent
e2594c79cc
commit
b1d3a1deea
2 changed files with 14 additions and 4 deletions
|
@ -67,11 +67,16 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) {
|
||||||
Debug::log(WARN, "Layersurface destroyed on an invalid monitor (removed?)");
|
Debug::log(WARN, "Layersurface destroyed on an invalid monitor (removed?)");
|
||||||
|
|
||||||
if (!layersurface->fadingOut && PMONITOR) {
|
if (!layersurface->fadingOut && PMONITOR) {
|
||||||
|
if (layersurface->mapped) {
|
||||||
|
Debug::log(LOG, "Forcing an unmap of a LS that did a straight destroy!");
|
||||||
|
listener_unmapLayerSurface(layersurface, nullptr);
|
||||||
|
} else {
|
||||||
Debug::log(LOG, "Removing LayerSurface that wasn't mapped.");
|
Debug::log(LOG, "Removing LayerSurface that wasn't mapped.");
|
||||||
layersurface->alpha.setValueAndWarp(0.f);
|
layersurface->alpha.setValueAndWarp(0.f);
|
||||||
layersurface->fadingOut = true;
|
layersurface->fadingOut = true;
|
||||||
g_pCompositor->m_vSurfacesFadingOut.push_back(layersurface);
|
g_pCompositor->m_vSurfacesFadingOut.push_back(layersurface);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
layersurface->noProcess = true;
|
layersurface->noProcess = true;
|
||||||
|
|
||||||
|
@ -101,6 +106,7 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
|
||||||
Debug::log(LOG, "LayerSurface %x mapped", layersurface->layerSurface);
|
Debug::log(LOG, "LayerSurface %x mapped", layersurface->layerSurface);
|
||||||
|
|
||||||
layersurface->layerSurface->mapped = true;
|
layersurface->layerSurface->mapped = true;
|
||||||
|
layersurface->mapped = true;
|
||||||
|
|
||||||
// fix if it changed its mon
|
// fix if it changed its mon
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output);
|
const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output);
|
||||||
|
@ -158,6 +164,8 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) {
|
||||||
g_pHyprOpenGL->makeLayerSnapshot(layersurface);
|
g_pHyprOpenGL->makeLayerSnapshot(layersurface);
|
||||||
layersurface->alpha = 0.f;
|
layersurface->alpha = 0.f;
|
||||||
|
|
||||||
|
layersurface->mapped = false;
|
||||||
|
|
||||||
layersurface->fadingOut = true;
|
layersurface->fadingOut = true;
|
||||||
|
|
||||||
g_pCompositor->m_vSurfacesFadingOut.push_back(layersurface);
|
g_pCompositor->m_vSurfacesFadingOut.push_back(layersurface);
|
||||||
|
|
|
@ -23,6 +23,8 @@ struct SLayerSurface {
|
||||||
Vector2D position;
|
Vector2D position;
|
||||||
zwlr_layer_shell_v1_layer layer;
|
zwlr_layer_shell_v1_layer layer;
|
||||||
|
|
||||||
|
bool mapped = false;
|
||||||
|
|
||||||
int monitorID = -1;
|
int monitorID = -1;
|
||||||
|
|
||||||
std::string szNamespace = "";
|
std::string szNamespace = "";
|
||||||
|
|
Loading…
Reference in a new issue