OSDN Git Service

kdeplasma-addons: do not suspend startup from virus wallpaper
authorIvailo Monev <xakepa10@gmail.com>
Thu, 31 Aug 2023 16:51:02 +0000 (19:51 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Thu, 31 Aug 2023 16:51:02 +0000 (19:51 +0300)
done by plasma-desktop itself, see:
kde-workspace/plasma/shells/plasma-desktop/plasmaapp.cpp

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kdeplasma-addons/wallpapers/virus/CMakeLists.txt
kdeplasma-addons/wallpapers/virus/virus.cpp
kdeplasma-addons/wallpapers/virus/virus.h

index ac76074..16e0db6 100644 (file)
@@ -8,12 +8,6 @@ set(virus_SRCS
     itemsview.cpp
 )
 
-if(KDE4WORKSPACE_FOUND)
-    add_definitions(-DHAVE_KWORKSPACE)
-    set(ksmserver_xml ${KDE4_DBUS_INTERFACES_INSTALL_DIR}/org.kde.KSMServerInterface.xml)
-    qt4_add_dbus_interface(virus_SRCS ${ksmserver_xml} ksmserver_interface)
-endif()
-
 kde4_add_plugin(plasma_wallpaper_virus ${virus_SRCS})
 target_link_libraries(plasma_wallpaper_virus
     KDE4::plasma
index 17acb52..c59ae32 100644 (file)
 #include "backgroundlistmodel.h"
 #include "backgrounddelegate.h"
 
-#if defined(HAVE_KWORKSPACE)
-#  include "ksmserver_interface.h"
-#endif
-
 K_EXPORT_PLASMA_WALLPAPER(virus, Virus)
 
 Virus::Virus(QObject *parent, const QVariantList &args)
     : Plasma::Wallpaper(parent, args),
       m_configWidget(0),
       m_model(0),
-      m_dialog(0),
-      m_startupResumed(false)
+      m_dialog(0)
 {
     connect(this, SIGNAL(renderCompleted(QImage)), this, SLOT(updateBackground(QImage)));
     connect(&alife, SIGNAL(finished()), this, SLOT(virusUpdated()));
@@ -405,7 +400,6 @@ void Virus::renderWallpaper(const QString& image)
     }
 
     render(m_img, m_size, m_resizeMethod, m_color);
-    suspendStartup(true); // during KDE startup, make ksmserver until the wallpaper is ready
 }
 
 QString Virus::cacheId() const
@@ -422,26 +416,6 @@ void Virus::updateBackground(const QImage &img)
     emit update(boundingRect());
 }
 
-void Virus::suspendStartup(bool suspend)
-{
-#if defined(HAVE_KWORKSPACE)
-    if (m_startupResumed) {
-        return;
-    }
-
-    org::kde::KSMServerInterface ksmserver("org.kde.ksmserver", "/KSMServer", QDBusConnection::sessionBus());
-    const QString startupID("desktop wallpaper");
-    if (suspend) {
-        ksmserver.suspendStartup(startupID);
-    } else {
-        m_startupResumed = true;
-        ksmserver.resumeStartup(startupID);
-    }
-#else
-    Q_UNUSED(suspend);
-#endif // HAVE_KWORKSPACE
-}
-
 void Virus::updateScreenshot(QPersistentModelIndex index)
 {
     m_uiVirus.m_view->update(index);
index 9cccc4f..3d72ed0 100644 (file)
@@ -61,7 +61,6 @@ class Virus : public Plasma::Wallpaper
         void fillMetaInfo(Plasma::Package *b);
         bool setMetadata(QLabel *label, const QString &text);
         void renderWallpaper(const QString& image = QString());
-        void suspendStartup(bool suspend); // for ksmserver
         void calculateGeometry();
         void setSingleImage();
         QString cacheId() const;
@@ -84,7 +83,6 @@ class Virus : public Plasma::Wallpaper
         QSize m_size;
         QString m_img;
         QDateTime m_previousModified;
-        bool m_startupResumed;
 
         QTimer m_timer;