mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 14:35:57 +01:00
session: destroy screencast_instance directly when paused
A PipeWire client might pause the stream which enables us to stop requesting buffers from the compositor. In this case the the quit bool won't be enacted on and thus we should destroy it directly from here.
This commit is contained in:
parent
10a07f7e90
commit
21d26fe23e
1 changed files with 7 additions and 1 deletions
|
@ -68,9 +68,15 @@ void xdpw_session_destroy(struct xdpw_session *sess) {
|
|||
logprint(DEBUG, "xdpw: screencast instance %p now has %d references",
|
||||
cast, cast->refcount);
|
||||
if (cast->refcount < 1) {
|
||||
if (cast->frame_state == XDPW_FRAME_STATE_NONE) {
|
||||
logprint(TRACE, "xdpw: screencast instance not streaming, destroy it");
|
||||
xdpw_screencast_instance_destroy(cast);
|
||||
} else {
|
||||
logprint(TRACE, "xdpw: screencast instance still streaming, set quit flag");
|
||||
cast->quit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sd_bus_slot_unref(sess->slot);
|
||||
wl_list_remove(&sess->link);
|
||||
|
|
Loading…
Reference in a new issue