diff --git a/kglobalaccel/main.cpp b/kglobalaccel/main.cpp index 93c22986..c1cfd89b 100644 --- a/kglobalaccel/main.cpp +++ b/kglobalaccel/main.cpp @@ -68,6 +68,7 @@ int main(int argc, char **argv) // This app is started automatically, no need for session management app.disableSessionManagement(); app.setQuitOnLastWindowClosed(false); + app.quitOnSignal(); QDBusConnection session = QDBusConnection::sessionBus(); if (!session.isConnected()) { diff --git a/knotify/main.cpp b/knotify/main.cpp index 9e0d589b..5d0fd7ea 100644 --- a/knotify/main.cpp +++ b/knotify/main.cpp @@ -54,6 +54,7 @@ int main(int argc, char **argv) // in which case there is a deadlock with ksmserver waiting for knotify to finish // startup and knotify waiting to register with ksmserver app.disableSessionManagement(); + app.quitOnSignal(); QDBusConnection session = QDBusConnection::sessionBus(); if (!session.isConnected()) { diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp index 5eb90b0d..3dc79620 100644 --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -46,7 +46,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #include #include - #include #include #include @@ -65,7 +64,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include -#include +#include +#include #include #include @@ -81,13 +81,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include - -#include "moc_server.cpp" - #include -#include #include #include +#include KSMServer* the_server = 0; @@ -706,10 +703,9 @@ KSMServer::KSMServer( const QString& windowManager, bool _only_local, bool locks connect( con, SIGNAL(activated(int)), this, SLOT(newConnection(int)) ); } - signal(SIGHUP, sighandler); - signal(SIGTERM, sighandler); - signal(SIGINT, sighandler); - signal(SIGPIPE, SIG_IGN); + KDE_signal(SIGHUP, sighandler); + KDE_signal(SIGTERM, sighandler); + KDE_signal(SIGINT, sighandler); connect( &protectionTimer, SIGNAL(timeout()), this, SLOT(protectionTimeout()) ); connect( &restoreTimer, SIGNAL(timeout()), this, SLOT(tryRestoreNext()) ); @@ -743,14 +739,14 @@ void KSMServer::cleanUp() ::unlink(fName.data()); FreeAuthenticationData(numTransports, authDataEntries); - signal(SIGTERM, SIG_DFL); - signal(SIGINT, SIG_DFL); + + KDE_signal(SIGTERM, SIG_DFL); + KDE_signal(SIGINT, SIG_DFL); KDisplayManager().shutdown( shutdownType, shutdownMode ); } - void* KSMServer::watchConnection( IceConn iceConn ) { KSMConnection* conn = new KSMConnection( iceConn ); @@ -1067,3 +1063,5 @@ void KSMServer::rebootWithoutConfirmation() { shutdown(KWorkSpace::ShutdownConfirmNo, KWorkSpace::ShutdownTypeReboot, KWorkSpace::ShutdownModeDefault); } + +#include "moc_server.cpp" diff --git a/kuiserver/main.cpp b/kuiserver/main.cpp index 3e336fd7..ce07146a 100644 --- a/kuiserver/main.cpp +++ b/kuiserver/main.cpp @@ -53,6 +53,7 @@ int main(int argc, char **argv) // This app is started automatically, no need for session management app.disableSessionManagement(); app.setQuitOnLastWindowClosed(false); + app.quitOnSignal(); QDBusConnection session = QDBusConnection::sessionBus(); if (!session.isConnected()) {