aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMykola Perehudov <[email protected]>2023-07-06 16:24:49 +0300
committerGitHub <[email protected]>2023-07-06 15:24:49 +0200
commit41358c6fb579e440ccb72bb79a7bfb859944b3a6 (patch)
tree413a7260db30431de33486a110ea090866f99eed
parentbbedb065e1fbb39bc6bdbd66b61c48fcff4a17a4 (diff)
downloadHyprland-41358c6fb579e440ccb72bb79a7bfb859944b3a6.tar.gz
Hyprland-41358c6fb579e440ccb72bb79a7bfb859944b3a6.zip
Cleanup compositor deadcode (#2657)
* Remove dead code as it is a part of CCompositor::cleanup * Unify sd_notify logic with Compositor lifetime
-rw-r--r--src/Compositor.cpp5
-rw-r--r--src/main.cpp16
2 files changed, 5 insertions, 16 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index b15414e1..ae3ef109 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -310,6 +310,11 @@ void CCompositor::cleanup() {
m_bIsShuttingDown = true;
+#ifdef USES_SYSTEMD
+ if (sd_booted() > 0)
+ sd_notify(0, "STOPPING=1");
+#endif
+
// unload all remaining plugins while the compositor is
// still in a normal working state.
g_pPluginSystem->unloadAllPlugins();
diff --git a/src/main.cpp b/src/main.cpp
index 8f25574b..aba5aba3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -11,10 +11,6 @@
#include <string>
#include <filesystem>
-#ifdef USES_SYSTEMD
-#include <systemd/sd-daemon.h> // for sd_notify
-#endif
-
void help() {
std::cout << "usage: Hyprland [arg [...]].\n";
std::cout << "\nArguments:\n";
@@ -102,17 +98,5 @@ int main(int argc, char** argv) {
// If we are here it means we got yote.
Debug::log(LOG, "Hyprland reached the end.");
-#ifdef USES_SYSTEMD
- // tell systemd it destroy bound/related units
- if (sd_booted() > 0)
- sd_notify(0, "STOPPING=1");
-#endif
-
- if (g_pCompositor->m_sWLDisplay)
- wl_display_destroy_clients(g_pCompositor->m_sWLDisplay);
-
- if (g_pCompositor->m_sWLDisplay)
- wl_display_destroy(g_pCompositor->m_sWLDisplay);
-
return EXIT_SUCCESS;
}