summaryrefslogtreecommitdiff
path: root/src/protocols/Screencopy.cpp
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2024-07-24 12:07:36 -0500
committerGitHub <noreply@github.com>2024-07-24 19:07:36 +0200
commit3e543d2ce8ba64abb4d226dbb88c4513474501cf (patch)
treed340935c65520e293a73623c148219993e38779b /src/protocols/Screencopy.cpp
parent735e3c6c56d22059ee6340c0327e4b5a9154f013 (diff)
core: Properly shutdown wl display (#7018)
* correctly destroy wayland globals * properly shutdown and cleanup hyprland * appease the nitpick gods and some comments
Diffstat (limited to 'src/protocols/Screencopy.cpp')
-rw-r--r--src/protocols/Screencopy.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp
index 5d1c9332..98cb0be9 100644
--- a/src/protocols/Screencopy.cpp
+++ b/src/protocols/Screencopy.cpp
@@ -16,15 +16,22 @@ static void bindManagerInt(wl_client* client, void* data, uint32_t version, uint
}
static void handleDisplayDestroy(struct wl_listener* listener, void* data) {
- g_pProtocolManager->m_pScreencopyProtocolManager->displayDestroy();
+ CScreencopyProtocolManager* proto = wl_container_of(listener, proto, m_liDisplayDestroy);
+ proto->displayDestroy();
}
void CScreencopyProtocolManager::displayDestroy() {
+ wl_list_remove(&m_liDisplayDestroy.link);
+ wl_list_init(&m_liDisplayDestroy.link);
wl_global_destroy(m_pGlobal);
}
static SScreencopyFrame* frameFromResource(wl_resource*);
+CScreencopyProtocolManager::~CScreencopyProtocolManager() {
+ displayDestroy();
+}
+
CScreencopyProtocolManager::CScreencopyProtocolManager() {
m_pGlobal = wl_global_create(g_pCompositor->m_sWLDisplay, &zwlr_screencopy_manager_v1_interface, SCREENCOPY_VERSION, this, bindManagerInt);