Skip to content

Commit

Permalink
screencopy: properly handle stream resume on all frame statuses
Browse files Browse the repository at this point in the history
fixes #162
  • Loading branch information
vaxerski committed Jan 5, 2024
1 parent 1c80212 commit 536e6ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/portals/Screencopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,15 @@ static void pwStreamStateChange(void* data, pw_stream_state old, pw_stream_state
PSTREAM->streamState = true;
if (PSTREAM->pSession->sharingData.status == FRAME_NONE)
g_pPortalManager->m_sPortals.screencopy->startFrameCopy(PSTREAM->pSession);
else {
if (PSTREAM->pSession->sharingData.frameCallback)
zwlr_screencopy_frame_v1_destroy(PSTREAM->pSession->sharingData.frameCallback);
if (PSTREAM->pSession->sharingData.windowFrameCallback)
hyprland_toplevel_export_frame_v1_destroy(PSTREAM->pSession->sharingData.windowFrameCallback);
PSTREAM->pSession->sharingData.windowFrameCallback = nullptr;
PSTREAM->pSession->sharingData.frameCallback = nullptr;
g_pPortalManager->m_sPortals.screencopy->startFrameCopy(PSTREAM->pSession);
}
break;
default: PSTREAM->streamState = false; break;
}
Expand Down

0 comments on commit 536e6ed

Please sign in to comment.