mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-26 07:55:58 +01:00
screencopy: properly handle stream resume on all frame statuses
fixes #162
This commit is contained in:
parent
1c802128f6
commit
536e6ed570
1 changed files with 9 additions and 0 deletions
|
@ -751,6 +751,15 @@ static void pwStreamStateChange(void* data, pw_stream_state old, pw_stream_state
|
||||||
PSTREAM->streamState = true;
|
PSTREAM->streamState = true;
|
||||||
if (PSTREAM->pSession->sharingData.status == FRAME_NONE)
|
if (PSTREAM->pSession->sharingData.status == FRAME_NONE)
|
||||||
g_pPortalManager->m_sPortals.screencopy->startFrameCopy(PSTREAM->pSession);
|
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;
|
break;
|
||||||
default: PSTREAM->streamState = false; break;
|
default: PSTREAM->streamState = false; break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue