| 62 |
#include <Plasma/AccessManager> |
#include <Plasma/AccessManager> |
| 63 |
#include <Plasma/AuthorizationManager> |
#include <Plasma/AuthorizationManager> |
| 64 |
#include <Plasma/Containment> |
#include <Plasma/Containment> |
|
#include <Plasma/Theme> |
|
| 65 |
#include <Plasma/Dialog> |
#include <Plasma/Dialog> |
| 66 |
|
#include <Plasma/Theme> |
| 67 |
|
#include <Plasma/Wallpaper> |
| 68 |
|
|
| 69 |
#include <kephal/screens.h> |
#include <kephal/screens.h> |
| 70 |
|
|
| 100 |
m_controllerDialog(0), |
m_controllerDialog(0), |
| 101 |
m_zoomLevel(Plasma::DesktopZoom), |
m_zoomLevel(Plasma::DesktopZoom), |
| 102 |
m_panelHidden(0), |
m_panelHidden(0), |
| 103 |
m_mapper(new QSignalMapper(this)) |
m_mapper(new QSignalMapper(this)), |
| 104 |
|
m_startupSuspendWaitCount(0) |
| 105 |
{ |
{ |
| 106 |
|
PlasmaApp::suspendStartup(true); |
| 107 |
KGlobal::locale()->insertCatalog("libplasma"); |
KGlobal::locale()->insertCatalog("libplasma"); |
| 108 |
KGlobal::locale()->insertCatalog("plasmagenericshell"); |
KGlobal::locale()->insertCatalog("plasmagenericshell"); |
| 109 |
KCrash::setFlags(KCrash::AutoRestart); |
KCrash::setFlags(KCrash::AutoRestart); |
| 155 |
|
|
| 156 |
new PlasmaAppAdaptor(this); |
new PlasmaAppAdaptor(this); |
| 157 |
QDBusConnection::sessionBus().registerObject("/App", this); |
QDBusConnection::sessionBus().registerObject("/App", this); |
|
notifyStartup(false); |
|
| 158 |
|
|
| 159 |
// Enlarge application pixmap cache |
// Enlarge application pixmap cache |
| 160 |
// Calculate the size required to hold background pixmaps for all screens. |
// Calculate the size required to hold background pixmaps for all screens. |
| 286 |
palette.setColor(desktop()->backgroundRole(), Qt::black); |
palette.setColor(desktop()->backgroundRole(), Qt::black); |
| 287 |
desktop()->setPalette(palette); |
desktop()->setPalette(palette); |
| 288 |
|
|
|
// and now, let everyone know we're ready! |
|
|
notifyStartup(true); |
|
| 289 |
connect(this, SIGNAL(aboutToQuit()), this, SLOT(cleanup())); |
connect(this, SIGNAL(aboutToQuit()), this, SLOT(cleanup())); |
| 290 |
} |
} |
| 291 |
|
|
| 615 |
c->initializeLayout(); |
c->initializeLayout(); |
| 616 |
c->processUpdateScripts(); |
c->processUpdateScripts(); |
| 617 |
c->checkScreens(); |
c->checkScreens(); |
| 618 |
kDebug() << " ------------------------------------------>" << t.elapsed(); |
foreach (Plasma::Containment *containment, c->containments()) { |
| 619 |
|
if (containment->screen() != -1 && containment->wallpaper()) { |
| 620 |
|
++m_startupSuspendWaitCount; |
| 621 |
|
connect(containment->wallpaper(), SIGNAL(update(QRectF)), this, SLOT(wallpaperCheckedIn())); |
| 622 |
|
} |
| 623 |
|
} |
| 624 |
|
|
| 625 |
|
QTimer::singleShot(5000, this, SLOT(wallpaperCheckInTimeout())); |
| 626 |
|
kDebug() << " ------------------------------------------>" << t.elapsed() << m_startupSuspendWaitCount; |
| 627 |
} |
} |
| 628 |
|
|
| 629 |
return m_corona; |
return m_corona; |
| 630 |
} |
} |
| 631 |
|
|
| 632 |
/*void PlasmaApp::showAppletBrowser() |
void PlasmaApp::wallpaperCheckInTimeout() |
| 633 |
{ |
{ |
| 634 |
Plasma::Containment *containment = dynamic_cast<Plasma::Containment *>(sender()); |
if (m_startupSuspendWaitCount > 0) { |
| 635 |
|
m_startupSuspendWaitCount = 0; |
| 636 |
|
suspendStartup(false); |
| 637 |
|
} |
| 638 |
|
} |
| 639 |
|
|
| 640 |
if (!containment) { |
void PlasmaApp::wallpaperCheckedIn() |
| 641 |
|
{ |
| 642 |
|
if (m_startupSuspendWaitCount < 1) { |
| 643 |
return; |
return; |
| 644 |
} |
} |
| 645 |
|
|
| 646 |
foreach (DesktopView *view, m_desktops) { |
--m_startupSuspendWaitCount; |
| 647 |
if (view->isDashboardVisible() && |
if (m_startupSuspendWaitCount < 1) { |
| 648 |
(view->containment() == containment || view->dashboardContainment() == containment)) { |
m_startupSuspendWaitCount = 0; |
| 649 |
// the dashboard will pick this one up! |
suspendStartup(false); |
|
return; |
|
|
} |
|
| 650 |
} |
} |
| 651 |
|
} |
|
showAppletBrowser(containment); |
|
|
}*/ |
|
| 652 |
|
|
| 653 |
bool PlasmaApp::hasComposite() |
bool PlasmaApp::hasComposite() |
| 654 |
{ |
{ |
| 660 |
#endif |
#endif |
| 661 |
} |
} |
| 662 |
|
|
| 663 |
void PlasmaApp::notifyStartup(bool completed) |
void PlasmaApp::suspendStartup(bool suspend) |
| 664 |
{ |
{ |
| 665 |
org::kde::KSMServerInterface ksmserver("org.kde.ksmserver", "/KSMServer", QDBusConnection::sessionBus()); |
org::kde::KSMServerInterface ksmserver("org.kde.ksmserver", "/KSMServer", QDBusConnection::sessionBus()); |
| 666 |
|
|
| 667 |
const QString startupID("workspace desktop"); |
const QString startupID("workspace desktop"); |
| 668 |
if (completed) { |
if (suspend) { |
|
ksmserver.resumeStartup(startupID); |
|
|
} else { |
|
| 669 |
ksmserver.suspendStartup(startupID); |
ksmserver.suspendStartup(startupID); |
| 670 |
|
} else { |
| 671 |
|
ksmserver.resumeStartup(startupID); |
| 672 |
} |
} |
| 673 |
} |
} |
| 674 |
|
|