From f16f170433540d85cf672217bca2d64c6db9eb01 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 14 Jan 2025 08:44:09 -0800 Subject: [PATCH] protocols: immediately copy toplevel content when ignoreDamage set (#9049) Also sets m_ignoreDamage, as it wasn't set before. --- src/protocols/ToplevelExport.cpp | 9 +++++++-- src/protocols/ToplevelExport.hpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp index 0ddd84c88b8..73e5cad9ccc 100644 --- a/src/protocols/ToplevelExport.cpp +++ b/src/protocols/ToplevelExport.cpp @@ -202,7 +202,12 @@ void CToplevelExportFrame::copy(CHyprlandToplevelExportFrameV1* pFrame, wl_resou buffer = PBUFFER->buffer; - PROTO::toplevelExport->m_vFramesAwaitingWrite.emplace_back(self); + m_ignoreDamage = ignoreDamage; + + if (ignoreDamage && validMapped(pWindow)) + share(); + else + PROTO::toplevelExport->m_vFramesAwaitingWrite.emplace_back(self); } void CToplevelExportFrame::share() { @@ -226,7 +231,7 @@ void CToplevelExportFrame::share() { resource->sendFlags((hyprlandToplevelExportFrameV1Flags)0); - if (!ignoreDamage) { + if (!m_ignoreDamage) { resource->sendDamage(0, 0, box.width, box.height); } diff --git a/src/protocols/ToplevelExport.hpp b/src/protocols/ToplevelExport.hpp index 956a085be3e..8d734dbda0b 100644 --- a/src/protocols/ToplevelExport.hpp +++ b/src/protocols/ToplevelExport.hpp @@ -52,7 +52,7 @@ class CToplevelExportFrame { PHLWINDOW pWindow; bool cursorOverlayRequested = false; - bool ignoreDamage = false; + bool m_ignoreDamage = false; bool lockedSWCursors = false; WP buffer;