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
v3.5.13-sru
tpearson 15 years ago
parent ab252e87d2
commit 1c9a50141d

@ -102,6 +102,15 @@ KBackgroundManager::KBackgroundManager(QWidget *desktop, KWinModule* kwinModule)
#if (QT_VERSION-0 >= 0x030200) #if (QT_VERSION-0 >= 0x030200)
connect( kapp->desktop(), SIGNAL( resized( int )), SLOT( desktopResized())); // RANDR support connect( kapp->desktop(), SIGNAL( resized( int )), SLOT( desktopResized())); // RANDR support
#endif #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);
}
} }
@ -545,7 +554,8 @@ void KBackgroundManager::slotImageDone(int desk)
delete pm; delete pm;
if (current) if (current)
exportBackground(desk, realDesktop()); //exportBackground(desk, realDesktop());
exportBackground(desk, desk);
if( do_cleanup ) if( do_cleanup )
{ {

@ -206,6 +206,8 @@ void KMiniPagerButton::backgroundChanged()
void KMiniPagerButton::loadBgPixmap() void KMiniPagerButton::loadBgPixmap()
{ {
bool retval;
if (m_pager->bgType() != PagerSettings::EnumBackgroundType::BgLive) if (m_pager->bgType() != PagerSettings::EnumBackgroundType::BgLive)
return; // not needed return; // not needed
@ -257,7 +259,13 @@ void KMiniPagerButton::loadBgPixmap()
connect(s_commonSharedPixmap, SIGNAL(done(bool)), connect(s_commonSharedPixmap, SIGNAL(done(bool)),
SLOT(backgroundLoaded(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 else
{ {
@ -267,7 +275,13 @@ void KMiniPagerButton::loadBgPixmap()
connect(m_sharedPixmap, SIGNAL(done(bool)), connect(m_sharedPixmap, SIGNAL(done(bool)),
SLOT(backgroundLoaded(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));
}
} }
} }

@ -198,6 +198,8 @@ QPixmap fastScalePixmap(const QPixmap &pixmap, int width, int height)
void Desktop::loadBgPixmap(void) void Desktop::loadBgPixmap(void)
{ {
bool retval;
// if (!m_bgDirty) return; // if (!m_bgDirty) return;
DCOPClient *client = kapp->dcopClient(); DCOPClient *client = kapp->dcopClient();
if (!client->isAttached()) if (!client->isAttached())
@ -252,17 +254,19 @@ void Desktop::loadBgPixmap(void)
kdDebug() << "getting whole bg through shpixmap\n"; kdDebug() << "getting whole bg through shpixmap\n";
*/ */
QDataStream args( data, IO_WriteOnly );
args << 1;
client->send( "kdesktop", "KBackgroundIface", "setExport(int)", data );
if (!m_bgPixmap) if (!m_bgPixmap)
{ {
m_bgPixmap = new KSharedPixmap; m_bgPixmap = new KSharedPixmap;
connect(m_bgPixmap, SIGNAL(done(bool)), SLOT(backgroundLoaded(bool))); 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));
}
} }

Loading…
Cancel
Save