diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-08 19:47:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-08 19:47:41 +0000 |
commit | 20957d880f050d82c71939cb750c54a6dcfd70f4 (patch) | |
tree | d513e74daa32b26688133f2f87f0646df82fe2bc /kdesktop | |
parent | 6171b5113040c768f68b673ec0e8ae2f82c64391 (diff) | |
download | tdebase-20957d880f050d82c71939cb750c54a6dcfd70f4.tar.gz tdebase-20957d880f050d82c71939cb750c54a6dcfd70f4.zip |
Revert patch r1227273 due to a desktop drag-and-drop bug it introduced
This temporarily reintroduces bug 456
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1240473 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdesktop')
-rw-r--r-- | kdesktop/bgmanager.cc | 11 | ||||
-rw-r--r-- | kdesktop/bgmanager.h | 2 | ||||
-rw-r--r-- | kdesktop/desktop.cc | 32 | ||||
-rw-r--r-- | kdesktop/desktop.h | 3 | ||||
-rw-r--r-- | kdesktop/krootwm.cc | 2 |
5 files changed, 22 insertions, 28 deletions
diff --git a/kdesktop/bgmanager.cc b/kdesktop/bgmanager.cc index 6d227eced..efabdbf2e 100644 --- a/kdesktop/bgmanager.cc +++ b/kdesktop/bgmanager.cc @@ -59,20 +59,9 @@ extern KDesktopApp *myApp; /**** KBackgroundManager ****/ -KBackgroundManager::KBackgroundManager() - : DCOPObject("KBackgroundIface") -{ - // Everything will be initialized later -} - KBackgroundManager::KBackgroundManager(TQWidget *desktop, KWinModule* kwinModule) : DCOPObject("KBackgroundIface") { - initializeManager(desktop, kwinModule); -} - -void KBackgroundManager::initializeManager(TQWidget *desktop, KWinModule* kwinModule) -{ if( !properties_inited ) { prop_root = XInternAtom(qt_xdisplay(), "_XROOTPMAP_ID", False); diff --git a/kdesktop/bgmanager.h b/kdesktop/bgmanager.h index af16e22ed..485d6520b 100644 --- a/kdesktop/bgmanager.h +++ b/kdesktop/bgmanager.h @@ -61,11 +61,9 @@ class KBackgroundManager TQ_OBJECT public: - KBackgroundManager(); KBackgroundManager(TQWidget *desktop, KWinModule* kwinModule); ~KBackgroundManager(); - void initializeManager(TQWidget *desktop, KWinModule* kwinModule); void configure(); void setCommon(int); bool isCommon() { return m_bCommon; }; diff --git a/kdesktop/desktop.cc b/kdesktop/desktop.cc index 1b047bd66..a3ddff56f 100644 --- a/kdesktop/desktop.cc +++ b/kdesktop/desktop.cc @@ -20,6 +20,7 @@ #include "desktop.h" #include "krootwm.h" +#include "bgmanager.h" #include "bgsettings.h" #include "startupid.h" #include "kdiconview.h" @@ -196,6 +197,7 @@ KDesktop::KDesktop( bool x_root_hack, bool wait_for_kded ) : m_pIconView = 0; m_pRootWidget = 0; + bgMgr = 0; initRoot(); TQTimer::singleShot(0, this, TQT_SLOT( slotStart() )); @@ -216,6 +218,8 @@ KDesktop::initRoot() if ( !m_bDesktopEnabled && !m_pRootWidget ) { hide(); + delete bgMgr; + bgMgr = 0; if ( m_pIconView ) m_pIconView->saveIconPositions(); delete m_pIconView; @@ -239,9 +243,9 @@ KDesktop::initRoot() // Geert Jansen: backgroundmanager belongs here // TODO tell KBackgroundManager if we change widget() - bgMgr.initializeManager( m_pIconView, m_pKwinmodule ); - bgMgr.setExport(1); - connect( &bgMgr, TQT_SIGNAL( initDone()), TQT_SLOT( backgroundInitDone())); + bgMgr = new KBackgroundManager( m_pIconView, m_pKwinmodule ); + bgMgr->setExport(1); + connect( bgMgr, TQT_SIGNAL( initDone()), TQT_SLOT( backgroundInitDone())); if (!m_bInit) { delete KRootWm::self(); @@ -252,6 +256,8 @@ KDesktop::initRoot() } else if (m_bDesktopEnabled && !m_pIconView) { + delete bgMgr; + bgMgr = 0; delete m_pRootWidget; m_pRootWidget = 0; m_pIconView = new KDIconView( this, 0 ); @@ -278,9 +284,9 @@ KDesktop::initRoot() // Geert Jansen: backgroundmanager belongs here // TODO tell KBackgroundManager if we change widget() - bgMgr.initializeManager( m_pIconView, m_pKwinmodule ); - bgMgr.setExport(1); - connect( &bgMgr, TQT_SIGNAL( initDone()), TQT_SLOT( backgroundInitDone())); + bgMgr = new KBackgroundManager( m_pIconView, m_pKwinmodule ); + bgMgr->setExport(1); + connect( bgMgr, TQT_SIGNAL( initDone()), TQT_SLOT( backgroundInitDone())); // make sure it is initialized before we first call updateWorkArea() m_pIconView->initConfig( m_bInit ); @@ -430,6 +436,8 @@ KDesktop::~KDesktop() { delete m_miniCli; m_miniCli = 0; // see #120382 + delete bgMgr; + bgMgr = 0; delete startup_id; } @@ -929,11 +937,11 @@ void KDesktop::handleColorDropEvent(TQDropEvent * e) TQColor c; KColorDrag::decode(e, c); switch (result) { - case 1: bgMgr.setColor(c, true); break; - case 2: bgMgr.setColor(c, false); break; + case 1: bgMgr->setColor(c, true); break; + case 2: bgMgr->setColor(c, false); break; default: return; } - bgMgr.setWallpaper(0,0); + bgMgr->setWallpaper(0,0); } void KDesktop::handleImageDropEvent(TQDropEvent * e) @@ -985,7 +993,7 @@ void KDesktop::handleImageDropEvent(TQDropEvent * e) KTempFile tmpFile(KGlobal::dirs()->saveLocation("wallpaper"), ".png"); i.save(tmpFile.name(), "PNG"); kdDebug(1204) << "KDesktop::contentsDropEvent " << tmpFile.name() << endl; - bgMgr.setWallpaper(tmpFile.name()); + bgMgr->setWallpaper(tmpFile.name()); } } @@ -994,7 +1002,7 @@ void KDesktop::slotNewWallpaper(const KURL &url) // This is called when a file containing an image is dropped // (called by KonqOperations) if ( url.isLocalFile() ) - bgMgr.setWallpaper( url.path() ); + bgMgr->setWallpaper( url.path() ); else { // Figure out extension @@ -1006,7 +1014,7 @@ void KDesktop::slotNewWallpaper(const KURL &url) KURL localURL; localURL.setPath( tmpFile.name() ); // We pass 0 as parent window because passing the desktop is not a good idea KIO::NetAccess::file_copy( url, localURL, -1, true /*overwrite*/ ); - bgMgr.setWallpaper( localURL.path() ); + bgMgr->setWallpaper( localURL.path() ); } } diff --git a/kdesktop/desktop.h b/kdesktop/desktop.h index ceb3bf1dc..be1aeb796 100644 --- a/kdesktop/desktop.h +++ b/kdesktop/desktop.h @@ -21,7 +21,6 @@ #define __desktop_h__ #include "KDesktopIface.h" -#include "bgmanager.h" #include <tqwidget.h> #include <tqstringlist.h> @@ -191,7 +190,7 @@ private: KWinModule* m_pKwinmodule; - KBackgroundManager bgMgr; + KBackgroundManager* bgMgr; KDIconView *m_pIconView; KRootWidget *m_pRootWidget; diff --git a/kdesktop/krootwm.cc b/kdesktop/krootwm.cc index 3805e5c81..2ea6fa87c 100644 --- a/kdesktop/krootwm.cc +++ b/kdesktop/krootwm.cc @@ -69,7 +69,7 @@ KRootWm * KRootWm::s_rootWm = 0; extern TQCString kdesktop_name, kicker_name, kwin_name; -KRootWm::KRootWm(KDesktop* _desktop) : TQObject(_desktop), startup(FALSE) +KRootWm::KRootWm(KDesktop* _desktop) : TQObject(_desktop) { s_rootWm = this; m_actionCollection = new KActionCollection(_desktop, this, "KRootWm::m_actionCollection"); |