diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-29 23:34:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-29 23:34:07 +0000 |
commit | 1c9a50141d128a02150d0adca3684f957e3e994f (patch) | |
tree | a08456d54c4a86731e77267069e5a02ef025d5ed | |
parent | ab252e87d243d448bb66749ee5836883fd5431a9 (diff) | |
download | tdebase-1c9a50141d128a02150d0adca3684f957e3e994f.tar.gz tdebase-1c9a50141d128a02150d0adca3684f957e3e994f.zip |
Fixed pager background loading failure on inactive desktop and high CPU usage on Desktop 1
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1108873 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | kdesktop/bgmanager.cc | 16 | ||||
-rw-r--r-- | kicker/applets/minipager/pagerbutton.cpp | 18 | ||||
-rw-r--r-- | kpager/desktop.cpp | 14 |
3 files changed, 38 insertions, 10 deletions
diff --git a/kdesktop/bgmanager.cc b/kdesktop/bgmanager.cc index 6274cf757..0beb49c93 100644 --- a/kdesktop/bgmanager.cc +++ b/kdesktop/bgmanager.cc @@ -97,11 +97,20 @@ KBackgroundManager::KBackgroundManager(QWidget *desktop, KWinModule* kwinModule) SLOT(slotChangeNumberOfDesktops(int))); connect(m_pKwinmodule, SIGNAL(currentDesktopViewportChanged(int, const QPoint&)), SLOT(slotChangeViewport(int, const QPoint&))); - + #if (QT_VERSION-0 >= 0x030200) connect( kapp->desktop(), SIGNAL( resized( int )), SLOT( desktopResized())); // RANDR support #endif + + QSize s(m_pKwinmodule->numberOfViewports(m_pKwinmodule->currentDesktop())); + m_numberOfViewports = s.width() * s.height(); + if (m_numberOfViewports < 1) { + m_numberOfViewports = 1; + } + for (unsigned j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) { + renderBackground(j); + } } @@ -307,7 +316,7 @@ void KBackgroundManager::slotChangeDesktop(int desk) if (m_numberOfViewports < 1) { m_numberOfViewports = 1; } - + if (desk == 0) desk = realDesktop(); else @@ -545,7 +554,8 @@ void KBackgroundManager::slotImageDone(int desk) delete pm; if (current) - exportBackground(desk, realDesktop()); + //exportBackground(desk, realDesktop()); + exportBackground(desk, desk); if( do_cleanup ) { diff --git a/kicker/applets/minipager/pagerbutton.cpp b/kicker/applets/minipager/pagerbutton.cpp index 06bd6ab6e..c17e0e1cb 100644 --- a/kicker/applets/minipager/pagerbutton.cpp +++ b/kicker/applets/minipager/pagerbutton.cpp @@ -206,6 +206,8 @@ void KMiniPagerButton::backgroundChanged() void KMiniPagerButton::loadBgPixmap() { + bool retval; + if (m_pager->bgType() != PagerSettings::EnumBackgroundType::BgLive) return; // not needed @@ -257,7 +259,13 @@ void KMiniPagerButton::loadBgPixmap() connect(s_commonSharedPixmap, SIGNAL(done(bool)), SLOT(backgroundLoaded(bool))); } - s_commonSharedPixmap->loadFromShared(QString("DESKTOP1")); + retval = s_commonSharedPixmap->loadFromShared(QString("DESKTOP1")); + if (retval == false) { + QDataStream args( data, IO_WriteOnly ); + args << 1; // Argument is 1 (true) + client->send(kdesktop_name, "KBackgroundIface", "setExport(int)", data); + retval = s_commonSharedPixmap->loadFromShared(QString("DESKTOP1")); + } } else { @@ -267,7 +275,13 @@ void KMiniPagerButton::loadBgPixmap() connect(m_sharedPixmap, SIGNAL(done(bool)), SLOT(backgroundLoaded(bool))); } - m_sharedPixmap->loadFromShared(QString("DESKTOP%1").arg(m_desktop)); + retval = m_sharedPixmap->loadFromShared(QString("DESKTOP%1").arg(m_desktop)); + if (retval == false) { + QDataStream args( data, IO_WriteOnly ); + args << 1; + client->send(kdesktop_name, "KBackgroundIface", "setExport(int)", data); + retval = m_sharedPixmap->loadFromShared(QString("DESKTOP%1").arg(m_desktop)); + } } } diff --git a/kpager/desktop.cpp b/kpager/desktop.cpp index 1ecfcca43..cb41bb04c 100644 --- a/kpager/desktop.cpp +++ b/kpager/desktop.cpp @@ -198,6 +198,8 @@ QPixmap fastScalePixmap(const QPixmap &pixmap, int width, int height) void Desktop::loadBgPixmap(void) { + bool retval; + // if (!m_bgDirty) return; DCOPClient *client = kapp->dcopClient(); if (!client->isAttached()) @@ -252,17 +254,19 @@ void Desktop::loadBgPixmap(void) kdDebug() << "getting whole bg through shpixmap\n"; */ - QDataStream args( data, IO_WriteOnly ); - args << 1; - client->send( "kdesktop", "KBackgroundIface", "setExport(int)", data ); - if (!m_bgPixmap) { m_bgPixmap = new KSharedPixmap; connect(m_bgPixmap, SIGNAL(done(bool)), SLOT(backgroundLoaded(bool))); } - m_bgPixmap->loadFromShared(QString("DESKTOP%1").arg(m_isCommon?1:m_desk)); + retval = m_bgPixmap->loadFromShared(QString("DESKTOP%1").arg(m_isCommon?1:m_desk)); + if (retval == false) { + QDataStream args( data, IO_WriteOnly ); + args << 1; // Argument is 1 (true) + client->send("kdesktop", "KBackgroundIface", "setExport(int)", data); + retval = m_bgPixmap->loadFromShared(QString("DESKTOP%1").arg(m_isCommon?1:m_desk)); + } } |