Fix fancy logout not allowing interaction with save dialogs

This closes Bug 922
Fix desktop wallpaper export failing when triggered by krootbacking or ksmserver and konsole or kdesktop_lock not previously loaded
pull/2/head
Timothy Pearson 12 years ago
parent d41f521719
commit d2f8fca98e

@ -54,6 +54,8 @@ public:
KRootBacking::KRootBacking() KRootBacking::KRootBacking()
: TQObject(KApplication::desktop(), "KRootBacking" ), m_Desk(0), m_timeout(0) : TQObject(KApplication::desktop(), "KRootBacking" ), m_Desk(0), m_timeout(0)
{ {
enableExports();
init(); init();
} }

@ -189,24 +189,6 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
// shall we save the session on logout? // shall we save the session on logout?
saveSession = ( config->readEntry( "loginMode", "restorePreviousLogout" ) == "restorePreviousLogout" ); saveSession = ( config->readEntry( "loginMode", "restorePreviousLogout" ) == "restorePreviousLogout" );
if (showFancyLogout) {
KSMShutdownIPFeedback::showit(); // hide the UGLY logout process from the user
shutdownNotifierIPDlg = KSMShutdownIPDlg::showShutdownIP();
while (!KSMShutdownIPFeedback::ispainted()) {
tqApp->processEvents();
}
}
// synchronize any folders that were requested for shutdown sync
if (shutdownNotifierIPDlg) {
static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Synchronizing remote folders").append("..."));
}
KRsync krs(this, "");
krs.executeLogoutAutoSync();
if (shutdownNotifierIPDlg) {
static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Saving your settings..."));
}
if ( saveSession ) if ( saveSession )
sessionGroup = TQString("Session: ") + SESSION_PREVIOUS_LOGOUT; sessionGroup = TQString("Session: ") + SESSION_PREVIOUS_LOGOUT;
@ -252,9 +234,9 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
completeShutdownOrCheckpoint(); completeShutdownOrCheckpoint();
} }
else { else {
if (showFancyLogout) { if (showFancyLogout) {
KSMShutdownIPFeedback::stop(); KSMShutdownIPFeedback::stop();
} }
} }
dialogActive = false; dialogActive = false;
} }
@ -502,6 +484,25 @@ void KSMServer::completeShutdownOrCheckpoint()
if ( waitForPhase2 ) if ( waitForPhase2 )
return; return;
bool showFancyLogout = KConfigGroup(KGlobal::config(), "Logout").readBoolEntry("showFancyLogout", true);
if (showFancyLogout) {
KSMShutdownIPFeedback::showit(); // hide the UGLY logout process from the user
shutdownNotifierIPDlg = KSMShutdownIPDlg::showShutdownIP();
while (!KSMShutdownIPFeedback::ispainted()) {
tqApp->processEvents();
}
}
// synchronize any folders that were requested for shutdown sync
if (shutdownNotifierIPDlg) {
static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Synchronizing remote folders").append("..."));
}
KRsync krs(this, "");
krs.executeLogoutAutoSync();
if (shutdownNotifierIPDlg) {
static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Saving your settings..."));
}
if ( saveSession ) if ( saveSession )
storeSession(); storeSession();
else else

@ -528,6 +528,11 @@ KSMShutdownIPFeedback::KSMShutdownIPFeedback()
: TQWidget( 0L, "systemmodaldialogclass", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop ), m_timeout(0), m_isPainted(false), m_sharedRootPixmap(NULL), mPixmapTimeout(0) : TQWidget( 0L, "systemmodaldialogclass", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop ), m_timeout(0), m_isPainted(false), m_sharedRootPixmap(NULL), mPixmapTimeout(0)
{ {
setShown(false);
hide();
enableExports();
m_sharedRootPixmap = new KRootPixmap(this); m_sharedRootPixmap = new KRootPixmap(this);
m_sharedRootPixmap->setCustomPainting(true); m_sharedRootPixmap->setCustomPainting(true);
connect(m_sharedRootPixmap, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)), this, TQT_SLOT(slotSetBackgroundPixmap(const TQPixmap &))); connect(m_sharedRootPixmap, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)), this, TQT_SLOT(slotSetBackgroundPixmap(const TQPixmap &)));
@ -554,15 +559,36 @@ KSMShutdownIPFeedback::KSMShutdownIPFeedback()
setBackgroundPixmap( m_root ); setBackgroundPixmap( m_root );
setGeometry( TQApplication::desktop()->geometry() ); setGeometry( TQApplication::desktop()->geometry() );
setBackgroundMode( TQWidget::NoBackground ); setBackgroundMode( TQWidget::NoBackground );
setShown(true);
} }
void KSMShutdownIPFeedback::showNow() void KSMShutdownIPFeedback::showNow()
{ {
setShown(true);
TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) ); TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) );
} }
void KSMShutdownIPFeedback::enableExports()
{
#ifdef Q_WS_X11
kdDebug(270) << k_lineinfo << "activating background exports.\n";
DCOPClient *client = kapp->dcopClient();
if (!client->isAttached()) {
client->attach();
}
TQByteArray data;
TQDataStream args( data, IO_WriteOnly );
args << 1;
TQCString appname( "kdesktop" );
int screen_number = DefaultScreen(tqt_xdisplay());
if ( screen_number )
appname.sprintf("kdesktop-screen-%d", screen_number );
client->send( appname, "KBackgroundIface", "setExport(int)", data );
#endif
}
KSMShutdownIPFeedback::~KSMShutdownIPFeedback() KSMShutdownIPFeedback::~KSMShutdownIPFeedback()
{ {
if (m_sharedRootPixmap) { if (m_sharedRootPixmap) {

@ -102,6 +102,13 @@ public slots:
void slotPaintEffect(); void slotPaintEffect();
void slotSetBackgroundPixmap(const TQPixmap &); void slotSetBackgroundPixmap(const TQPixmap &);
private:
/**
* Asks KDesktop to export the desktop background as a KSharedPixmap.
* This method uses DCOP to call KBackgroundIface/setExport(int).
*/
void enableExports();
private: private:
static KSMShutdownIPFeedback * s_pSelf; static KSMShutdownIPFeedback * s_pSelf;
KSMShutdownIPFeedback(); KSMShutdownIPFeedback();

Loading…
Cancel
Save