Skip to content

Commit

Permalink
subsurfaceTree: Fix nullptr crash when disconnecting a monitor (#4577)
Browse files Browse the repository at this point in the history
I was able to reproduce this frequently by having a kitty terminal on an
monitor running the following command and then unplugging that monitor:

`while true; do echo "" && sleep 0.02; done`
  • Loading branch information
abmantis committed Feb 1, 2024
1 parent cfd68af commit 15316aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/SubsurfaceTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void Events::listener_commitSubsurface(void* owner, void* data) {

// tearing: if solitary, redraw it. This still might be a single surface window
const auto PMONITOR = g_pCompositor->getMonitorFromID(pNode->pWindowOwner->m_iMonitorID);
if (PMONITOR->solitaryClient == pNode->pWindowOwner && pNode->pWindowOwner->canBeTorn() && PMONITOR->tearingState.canTear &&
if (PMONITOR && PMONITOR->solitaryClient == pNode->pWindowOwner && pNode->pWindowOwner->canBeTorn() && PMONITOR->tearingState.canTear &&
pNode->pSurface->wlr()->current.committed & WLR_SURFACE_STATE_BUFFER) {
CRegion damageBox{&pNode->pSurface->wlr()->buffer_damage};

Expand Down

0 comments on commit 15316aa

Please sign in to comment.