From 4f2f95ce18dc6290c3581b40ea4f20d05bd78d55 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 13 Jul 2011 04:09:29 +0000 Subject: Fix a second cause of the ever-ubiquitous Bug #456 This one is related to the MOC having a different idea of the data structure than the C compiler does in bgmanager.xx, thereby causing memory corruption when the bgmanager object attempts to access data members that the MOC did not add to the objects memory structure. Also apply the fix in r1420474 to KDesktopIface and KScreenSaverIface git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1241406 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdesktop/KDesktopIface.h | 4 +++- kdesktop/KScreensaverIface.h | 4 +++- kdesktop/bgmanager.h | 13 ++----------- kdesktop/desktop.cc | 2 +- kdesktop/desktop.h | 3 ++- kdesktop/kdesktopapp.h | 4 ++-- kdesktop/lockeng.cc | 2 +- kdesktop/lockeng.h | 2 +- 8 files changed, 15 insertions(+), 19 deletions(-) (limited to 'kdesktop') diff --git a/kdesktop/KDesktopIface.h b/kdesktop/KDesktopIface.h index abf98d93b..945fb4ca8 100644 --- a/kdesktop/KDesktopIface.h +++ b/kdesktop/KDesktopIface.h @@ -6,11 +6,13 @@ #include #include -class KDesktopIface : virtual public DCOPObject +class KDesktopIface : public DCOPObject { K_DCOP public: + KDesktopIface() : DCOPObject("KDesktopIface") {} + k_dcop: /** * @internal diff --git a/kdesktop/KScreensaverIface.h b/kdesktop/KScreensaverIface.h index 0ed26b67a..de5c19f2b 100644 --- a/kdesktop/KScreensaverIface.h +++ b/kdesktop/KScreensaverIface.h @@ -4,11 +4,13 @@ #include -class KScreensaverIface : virtual public DCOPObject +class KScreensaverIface : public DCOPObject { K_DCOP public: + KScreensaverIface() : DCOPObject("KScreensaverIface") {} + k_dcop: /** Lock the screen now even if the screensaver does not lock by default. */ virtual void lock() = 0; diff --git a/kdesktop/bgmanager.h b/kdesktop/bgmanager.h index 4e15b8df5..080c5a614 100644 --- a/kdesktop/bgmanager.h +++ b/kdesktop/bgmanager.h @@ -19,10 +19,6 @@ #define COMPOSITE #endif -#ifdef Q_MOC_RUN -#define COMPOSITE -#endif - class KConfig; class TQTimer; class TQPixmap; @@ -93,11 +89,8 @@ private slots: void desktopResized(); void clearRoot(); void saveImages(); - -#ifdef COMPOSITE void slotCmBackgroundChanged(bool); -#endif - + private: void applyCommon(bool common); void applyExport(bool _export); @@ -129,9 +122,7 @@ private: TQWidget *m_pDesktop; TQTimer *m_pTimer; -#ifdef COMPOSITE - KPixmap *m_tPixmap; -#endif + KPixmap *m_tPixmap; TQPtrVector m_Renderer; TQPtrVector m_Cache; diff --git a/kdesktop/desktop.cc b/kdesktop/desktop.cc index a3ddff56f..5696d2e4a 100644 --- a/kdesktop/desktop.cc +++ b/kdesktop/desktop.cc @@ -135,7 +135,7 @@ KDesktop::WheelDirection KDesktop::m_eWheelDirection = KDesktop::m_eDefaultWheel const char* KDesktop::m_wheelDirectionStrings[2] = { "Forward", "Reverse" }; KDesktop::KDesktop( bool x_root_hack, bool wait_for_kded ) : - DCOPObject( "KDesktopIface" ), + KDesktopIface(), TQWidget( 0L, "desktop", (WFlags)(WResizeNoErase | ( x_root_hack ? (WStyle_Customize | WStyle_NoBorder) : 0)) ), // those two WStyle_ break kdesktop when the root-hack isn't used (no Dnd) startup_id( NULL ), m_waitForKicker(0) diff --git a/kdesktop/desktop.h b/kdesktop/desktop.h index be1aeb796..4d3a81750 100644 --- a/kdesktop/desktop.h +++ b/kdesktop/desktop.h @@ -59,7 +59,8 @@ signals: * It handles the background, the screensaver and all the rest of the global stuff. * The icon view is a child widget of KDesktop. */ -class KDesktop : public TQWidget, virtual public KDesktopIface +class KDesktop : public TQWidget, + public KDesktopIface { Q_OBJECT diff --git a/kdesktop/kdesktopapp.h b/kdesktop/kdesktopapp.h index 22b47bda2..44b3caa54 100644 --- a/kdesktop/kdesktopapp.h +++ b/kdesktop/kdesktopapp.h @@ -49,14 +49,14 @@ class KDesktopApp : public KUniqueApplication return m_bgSupported; } #endif - + signals: void cmBackgroundChanged(bool supported); #ifdef COMPOSITE private: void initCmBackground(); - + private: Atom m_cmBackground; diff --git a/kdesktop/lockeng.cc b/kdesktop/lockeng.cc index 43c39f19f..af1207755 100644 --- a/kdesktop/lockeng.cc +++ b/kdesktop/lockeng.cc @@ -34,7 +34,7 @@ extern xautolock_corner_t xautolock_corners[ 4 ]; // a newly started process. // SaverEngine::SaverEngine() - : DCOPObject("KScreensaverIface"), + : KScreensaverIface(), TQWidget(), mBlankOnly(false) { diff --git a/kdesktop/lockeng.h b/kdesktop/lockeng.h index 72131a05c..9b125985f 100644 --- a/kdesktop/lockeng.h +++ b/kdesktop/lockeng.h @@ -24,7 +24,7 @@ class DCOPClientTransaction; */ class SaverEngine : public TQWidget, - virtual public KScreensaverIface + public KScreensaverIface { Q_OBJECT public: -- cgit v1.2.1