From b8fc53e69dba800f390656da40faeeeefe6142f3 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 1 Jul 2024 13:06:35 +0200 Subject: [PATCH] wayland: handle close events --- src/backend/Wayland.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/Wayland.cpp b/src/backend/Wayland.cpp index 846347d..fe26673 100644 --- a/src/backend/Wayland.cpp +++ b/src/backend/Wayland.cpp @@ -469,6 +469,13 @@ Aquamarine::CWaylandOutput::CWaylandOutput(const std::string& name_, Hyprutils:: sendFrameAndSetCallback(); }); + waylandState.xdgToplevel->setClose([this](CCXdgToplevel* r) { + events.destroy.emit(); + waylandState.surface->sendAttach(nullptr, 0, 0); + waylandState.surface->sendCommit(); + std::erase(backend->outputs, self.lock()); + }); + auto inputRegion = makeShared(backend->waylandState.compositor->sendCreateRegion()); inputRegion->sendAdd(0, 0, INT32_MAX, INT32_MAX);