From cb5f63cc72db47328d5c8890d19aaaa76f203d6e Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 26 May 2022 06:40:25 +0300 Subject: [PATCH] generic: disable session manager via SESSION_MANAGER environment variable unset too Signed-off-by: Ivailo Monev --- kglobalaccel/main.cpp | 4 ++-- knotify/main.cpp | 4 ++++ ksmserver/main.cpp | 2 +- kuiserver/main.cpp | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/kglobalaccel/main.cpp b/kglobalaccel/main.cpp index c1cfd89b..76c51cc4 100644 --- a/kglobalaccel/main.cpp +++ b/kglobalaccel/main.cpp @@ -37,11 +37,11 @@ int main(int argc, char **argv) { // Disable Session Management the right way (C) // - // ksmserver has global shortcuts. disableSessionManagement() does not prevent Qt from + // ksmserver has global shortcuts. disableSessionManagement() does not prevent Katie from // registering the app with the session manager. We remove the address to make sure we do not // get a hang on kglobalaccel restart (kglobalaccel tries to register with ksmserver, // ksmserver tries to register with kglobalaccel). - unsetenv( "SESSION_MANAGER" ); + ::unsetenv("SESSION_MANAGER"); KAboutData aboutdata( "kglobalaccel", diff --git a/knotify/main.cpp b/knotify/main.cpp index 5d0fd7ea..9448e857 100644 --- a/knotify/main.cpp +++ b/knotify/main.cpp @@ -36,6 +36,10 @@ int main(int argc, char **argv) { + // NOTE: disables session manager entirely, for reference: + // https://www.x.org/releases/X11R7.7/doc/libSM/xsmp.html + ::unsetenv("SESSION_MANAGER"); + KAboutData aboutdata("knotify", "knotify4", ki18n("KNotify"), KDE_VERSION_STRING, ki18n("KDE Notification Daemon"), KAboutData::License_GPL, ki18n("(C) 1997-2008, KDE Developers")); diff --git a/ksmserver/main.cpp b/ksmserver/main.cpp index 189f0086..c34e3871 100644 --- a/ksmserver/main.cpp +++ b/ksmserver/main.cpp @@ -251,7 +251,7 @@ int main( int argc, char* argv[] ) options.add("lockscreen", ki18n("Starts the session in locked mode")); KCmdLineArgs::addCmdLineOptions( options ); - putenv((char*)"SESSION_MANAGER="); + ::unsetenv("SESSION_MANAGER"); checkComposite(); KApplication *a; diff --git a/kuiserver/main.cpp b/kuiserver/main.cpp index ce07146a..53dc6be0 100644 --- a/kuiserver/main.cpp +++ b/kuiserver/main.cpp @@ -36,6 +36,10 @@ int main(int argc, char **argv) { + // NOTE: disables session manager entirely, for reference: + // https://www.x.org/releases/X11R7.7/doc/libSM/xsmp.html + ::unsetenv("SESSION_MANAGER"); + // GS 5/2001 - I changed the name to "KDE" to make it look better // in the titles of dialogs which are displayed. KAboutData aboutdata("kuiserver", "kdelibs4", ki18n("Job Manager"),