Skip to content

Commit 29dbec0

Browse files
committed
screencopy: wait longer to re-enable DS
1 parent 6ea4769 commit 29dbec0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/protocols/Screencopy.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,9 @@ void CScreencopyProtocol::destroyResource(CScreencopyClient* client) {
504504
std::erase_if(m_clients, [&](const auto& other) { return other.get() == client; });
505505
std::erase_if(m_frames, [&](const auto& other) { return other->m_client.get() == client; });
506506
std::erase_if(m_framesAwaitingWrite, [&](const auto& other) { return !other || other->m_client.get() == client; });
507+
508+
if (m_clients.empty())
509+
g_pHyprRenderer->m_directScanoutBlocked = false;
507510
}
508511

509512
void CScreencopyProtocol::destroyResource(CScreencopyFrame* frame) {
@@ -513,6 +516,10 @@ void CScreencopyProtocol::destroyResource(CScreencopyFrame* frame) {
513516

514517
void CScreencopyProtocol::onOutputCommit(PHLMONITOR pMonitor) {
515518
if (m_framesAwaitingWrite.empty()) {
519+
for (auto client : m_clients) {
520+
if (client->m_framesInLastHalfSecond > 0)
521+
return;
522+
}
516523
g_pHyprRenderer->m_directScanoutBlocked = false;
517524
return; // nothing to share
518525
}

0 commit comments

Comments
 (0)