OSDN Git Service

ksmserver: make KSMShutdownFeedback::stop() do the same thing as KSMShutdownFeedback...
authorIvailo Monev <xakepa10@gmail.com>
Sat, 19 Nov 2022 23:32:39 +0000 (01:32 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 19 Nov 2022 23:32:39 +0000 (01:32 +0200)
for some reason KSMShutdownFeedback::stop() was not doing anything when the
KWin effect was taking care of the logout effect but KWin also does not
apply the effect to windows other than the one created by ksmserver

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
ksmserver/shutdown.cpp
ksmserver/shutdowndlg.cpp
ksmserver/shutdowndlg.h
ksmserver/tests/test.cpp

index 2c9ea99..7eebae8 100644 (file)
@@ -117,7 +117,7 @@ void KSMServer::shutdown( KWorkSpace::ShutdownConfirm confirm,
     KSharedConfig::Ptr config = KGlobal::config();
     config->reparseConfiguration(); // config may have changed in the KControl module
 
-       KConfigGroup cg( config, "General");
+    KConfigGroup cg( config, "General");
 
     bool logoutConfirmed =
         (confirm == KWorkSpace::ShutdownConfirmYes) ? false :
@@ -214,7 +214,7 @@ void KSMServer::shutdown( KWorkSpace::ShutdownConfirm confirm,
         if ( clients.isEmpty() )
             completeShutdownOrCheckpoint();
     } else {
-        KSMShutdownFeedback::logoutCanceled(); // make the screen become normal again
+        KSMShutdownFeedback::stop(); // make the screen become normal again
     }
     dialogActive = false;
 }
@@ -374,7 +374,7 @@ void KSMServer::cancelShutdown( KSMClient* c )
     } else {
         Solid::PowerManagement::stopSuppressingSleep(inhibitCookie);
         kDebug( 1218 ) << "Client " << c->program() << " (" << c->clientId() << ") canceled shutdown.";
-        KSMShutdownFeedback::logoutCanceled(); // make the screen become normal again
+        KSMShutdownFeedback::stop(); // make the screen become normal again
         KNotification::event( "cancellogout" , i18n( "Logout canceled by '%1'", c->program()),
                               QPixmap() , 0l , KNotification::DefaultEvent  );
         foreach( KSMClient* c, clients ) {
index 1bb755c..bb48572 100644 (file)
@@ -93,10 +93,6 @@ void KSMShutdownFeedback::start()
 
 void KSMShutdownFeedback::stop()
 {
-}
-
-void KSMShutdownFeedback::logoutCanceled()
-{
     if( KWindowSystem::compositingActive()) {
         // We are no longer logging out, announce (Intended for the compositor)
         Display* dpy = QX11Info::display();
index 7f0ca1f..7f69ee8 100644 (file)
@@ -46,7 +46,6 @@ class KSMShutdownFeedback
 public:
     static void start();
     static void stop();
-    static void logoutCanceled();
 };
 
 // The confirmation dialog
index 183cbfe..c0e8c5a 100644 (file)
@@ -5,8 +5,8 @@
 #include <kiconloader.h>
 #include <kworkspace/kworkspace.h>
 #include <Plasma/Theme>
-int
-main(int argc, char *argv[])
+
+int main(int argc, char *argv[])
 {
     KAboutData about("kapptest", 0, ki18n("kapptest"), "version");
     KCmdLineArgs::init(argc, argv, &about);
@@ -20,7 +20,9 @@ main(int argc, char *argv[])
     KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
 
     KApplication a;
+    KApplication::quitOnSignal();
     KIconLoader::global()->addAppDir("ksmserver");
+    qAddPostRoutine(KSMShutdownFeedback::stop);
     KSMShutdownFeedback::start();
 
     QString sdtypeOption = args->getOption("type").toLower();
@@ -42,5 +44,5 @@ main(int argc, char *argv[])
     (void)KSMShutdownDlg::confirmShutdown( true, true, sdtype, "default" );
 /*   (void)KSMShutdownDlg::confirmShutdown( false, false, sdtype ); */
 
-    KSMShutdownFeedback::stop();
+    return a.exec();
 }