mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 18:05:58 +01:00
Fixed a crash
This commit is contained in:
parent
221acebf2c
commit
74379879dd
1 changed files with 2 additions and 2 deletions
|
@ -125,11 +125,11 @@ void Events::listener_monitorDestroy(wl_listener* listener, void* data) {
|
||||||
void Events::listener_newLayerSurface(wl_listener* listener, void* data) {
|
void Events::listener_newLayerSurface(wl_listener* listener, void* data) {
|
||||||
const auto WLRLAYERSURFACE = (wlr_layer_surface_v1*)data;
|
const auto WLRLAYERSURFACE = (wlr_layer_surface_v1*)data;
|
||||||
|
|
||||||
if (!WLRLAYERSURFACE->output->data) {
|
if (!WLRLAYERSURFACE->output || !WLRLAYERSURFACE->output->data) {
|
||||||
Debug::log(LOG, "New LayerSurface has no preferred monitor.");
|
Debug::log(LOG, "New LayerSurface has no preferred monitor.");
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto PMONITOR = (SMonitor*)(WLRLAYERSURFACE->output->data ? WLRLAYERSURFACE->output->data : g_pCompositor->getMonitorFromCursor());
|
const auto PMONITOR = (SMonitor*)((WLRLAYERSURFACE->output && WLRLAYERSURFACE->output->data) ? WLRLAYERSURFACE->output->data : g_pCompositor->getMonitorFromCursor());
|
||||||
PMONITOR->m_aLayerSurfaceLists[WLRLAYERSURFACE->pending.layer].push_back(new SLayerSurface());
|
PMONITOR->m_aLayerSurfaceLists[WLRLAYERSURFACE->pending.layer].push_back(new SLayerSurface());
|
||||||
SLayerSurface* layerSurface = PMONITOR->m_aLayerSurfaceLists[WLRLAYERSURFACE->pending.layer].back();
|
SLayerSurface* layerSurface = PMONITOR->m_aLayerSurfaceLists[WLRLAYERSURFACE->pending.layer].back();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue