Skip to content

Commit b8fc53e

Browse files
committed
wayland: handle close events
1 parent aadc5dd commit b8fc53e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/Wayland.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,13 @@ Aquamarine::CWaylandOutput::CWaylandOutput(const std::string& name_, Hyprutils::
469469
sendFrameAndSetCallback();
470470
});
471471

472+
waylandState.xdgToplevel->setClose([this](CCXdgToplevel* r) {
473+
events.destroy.emit();
474+
waylandState.surface->sendAttach(nullptr, 0, 0);
475+
waylandState.surface->sendCommit();
476+
std::erase(backend->outputs, self.lock());
477+
});
478+
472479
auto inputRegion = makeShared<CCWlRegion>(backend->waylandState.compositor->sendCreateRegion());
473480
inputRegion->sendAdd(0, 0, INT32_MAX, INT32_MAX);
474481

0 commit comments

Comments
 (0)