summaryrefslogtreecommitdiffstats
path: root/ksmserver
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-10 22:32:00 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-10 22:32:00 +0000
commit1f40ada72d693d681ec6a32c2ef717e8dd73b5bb (patch)
tree54c647b881fd1f91a9cd4390237ec0a8888a8f34 /ksmserver
parent29570c5acb30252e5db7552b89150035bbdd9409 (diff)
downloadtdebase-1f40ada72d693d681ec6a32c2ef717e8dd73b5bb.tar.gz
tdebase-1f40ada72d693d681ec6a32c2ef717e8dd73b5bb.zip
Force windows with the modal system notification atom set to stay above other windows
Enhance logout sequence appearance Add remote folder synchronization on logout support Fix flickering to black window with subsequent partial repaint of certain widgets occurring during fancy logout sequence git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1252640 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksmserver')
-rw-r--r--ksmserver/CMakeLists.txt2
-rw-r--r--ksmserver/server.cpp13
-rw-r--r--ksmserver/server.h2
-rw-r--r--ksmserver/shutdown.cpp27
-rw-r--r--ksmserver/shutdowndlg.cpp46
-rw-r--r--ksmserver/shutdowndlg.h8
6 files changed, 71 insertions, 27 deletions
diff --git a/ksmserver/CMakeLists.txt b/ksmserver/CMakeLists.txt
index 66a4b050b..042e36fe3 100644
--- a/ksmserver/CMakeLists.txt
+++ b/ksmserver/CMakeLists.txt
@@ -43,5 +43,5 @@ tde_add_kdeinit_executable( ksmserver AUTOMOC
main.cpp server.cpp shutdowndlg.cpp
legacy.cpp startup.cpp shutdown.cpp client.cpp
KSMServerInterface.skel server.skel timed.ui
- LINK dmctl-static kdeui-shared ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES}
+ LINK dmctl-static kdeui-shared krsync-shared ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES}
)
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index ce118a529..003abf3af 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -913,7 +913,18 @@ bool KSMServer::isWM( const TQString& program ) const
// therefore make sure it's recognized even if ksmserver
// was initially started with different WM, and kwin replaced
// it later
- return program == wm || program == "kwin";
+ return ((program == wm) || (program == "kwin"));
+}
+
+bool KSMServer::isCM( const KSMClient* client ) const
+{
+ return isCM( client->program());
+}
+
+bool KSMServer::isCM( const TQString& program ) const
+{
+ // Returns true if the program in question is a composition manager
+ return (program == "kompmgr");
}
bool KSMServer::defaultSession() const
diff --git a/ksmserver/server.h b/ksmserver/server.h
index 1fd55a217..c7224eb36 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -145,6 +145,8 @@ private:
bool isWM( const KSMClient* client ) const;
bool isWM( const TQString& program ) const;
+ bool isCM( const KSMClient* client ) const;
+ bool isCM( const TQString& program ) const;
bool defaultSession() const; // empty session
void setupXIOErrorHandler();
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index a153b2806..b5e40a50b 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -81,6 +81,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <kdebug.h>
#include <knotifyclient.h>
+#include <libkrsync/krsync.h>
+
#include "server.h"
#include "global.h"
#include "shutdowndlg.h"
@@ -182,6 +184,7 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
shutdownType = sdtype;
shutdownMode = sdmode;
bootOption = bopt;
+ shutdownNotifierIPDlg = 0;
// shall we save the session on logout?
saveSession = ( config->readEntry( "loginMode", "restorePreviousLogout" ) == "restorePreviousLogout" );
@@ -189,6 +192,19 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
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("");
}
if ( saveSession )
@@ -196,7 +212,9 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
// Set the real desktop background to black so that exit looks
// clean regardless of what was on "our" desktop.
- TQT_TQWIDGET(kapp->desktop())->setBackgroundColor( Qt::black );
+ if (!showFancyLogout) {
+ TQT_TQWIDGET(kapp->desktop())->setBackgroundColor( Qt::black );
+ }
state = Shutdown;
wmPhase1WaitingCount = 0;
saveType = saveSession?SmSaveBoth:SmSaveGlobal;
@@ -520,7 +538,7 @@ void KSMServer::startKilling()
// kill all clients
state = Killing;
for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
- if( isWM( c )) // kill the WM as the last one in order to reduce flicker
+ if( isWM( c ) || isCM( c ) ) // kill the WM and CM as the last one in order to reduce flicker
continue;
kdDebug( 1218 ) << "completeShutdown: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() );
@@ -539,7 +557,7 @@ void KSMServer::completeKilling()
if( state == Killing ) {
bool wait = false;
for( KSMClient* c = clients.first(); c; c = clients.next()) {
- if( isWM( c ))
+ if( isWM( c ) || isCM( c ) )
continue;
wait = true; // still waiting for clients to go away
}
@@ -563,6 +581,9 @@ void KSMServer::killWM()
kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() );
}
+ if( isCM( c )) {
+ SmsDie( c->connection() );
+ }
}
if( iswm ) {
completeKillingWM();
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index c49e31974..1fc5af648 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -516,19 +516,18 @@ void KSMShutdownFeedback::slotPaintEffect()
KSMShutdownIPFeedback * KSMShutdownIPFeedback::s_pSelf = 0L;
KSMShutdownIPFeedback::KSMShutdownIPFeedback()
- : TQWidget( 0L, "feedbackipwidget", Qt::WType_Dialog | Qt::WStyle_StaysOnTop ), m_timeout(0)
+ : TQWidget( 0L, "feedbackipwidget", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop ), m_timeout(0), m_isPainted(false)
{
- setShown(false);
- setWindowState(WindowFullScreen);
-
// Try to get the root pixmap
system("krootbacking &");
+
+ resize(0, 0);
+ setShown(true);
}
void KSMShutdownIPFeedback::showNow()
{
-// slotPaintEffect();
TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) );
}
@@ -588,11 +587,15 @@ void KSMShutdownIPFeedback::slotPaintEffect()
pm.convertFromImage(correctedImage);
}
- resize(kapp->desktop()->width(), kapp->desktop()->height());
+ setBackgroundPixmap( pm );
move(0,0);
- setShown(true);
+ setWindowState(WindowFullScreen);
+ setGeometry( TQApplication::desktop()->geometry() );
- setBackgroundPixmap( pm );
+ repaint(true);
+ tqApp->flushX();
+
+ m_isPainted = true;
}
void KSMShutdownIPFeedback::enableExports()
@@ -1106,22 +1109,25 @@ TQWidget* KSMShutdownIPDlg::showShutdownIP()
l->move(rect.x() + (rect.width() - sh.width())/2,
rect.y() + (rect.height() - sh.height())/2);
- TQTimer *timer = new TQTimer(l);
- connect( timer, SIGNAL(timeout()), l, SLOT(exec()) );
- timer->start( 0, TRUE );
-
kapp->disableStyles();
return l;
}
+void KSMShutdownIPDlg::setStatusMessage(TQString message)
+{
+ if (message == "") {
+ m_statusLabel->setText(i18n("Saving your settings").append("..."));
+ }
+ else {
+ m_statusLabel->setText(message);
+ }
+}
+
KSMShutdownIPDlg::KSMShutdownIPDlg(TQWidget* parent)
- : TQDialog( 0, "", TRUE, Qt::WStyle_Customize | Qt::WType_Dialog | Qt::WStyle_Title | Qt::WDestructiveClose )
+ : TQWidget( 0, "", Qt::WStyle_Customize | Qt::WType_Dialog | Qt::WStyle_Title | Qt::WStyle_StaysOnTop | Qt::WDestructiveClose )
{
- // Signal that this window should stay on top of everything else
- setModal(true);
-
// Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
@@ -1182,12 +1188,12 @@ KSMShutdownIPDlg::KSMShutdownIPDlg(TQWidget* parent)
label->setFont( fnt );
centerbox->addWidget( label, AlignCenter );
- label = new TQLabel( i18n("Saving your settings..."), frame );
- fnt = label->font();
+ m_statusLabel = new TQLabel( i18n("Saving your settings..."), frame );
+ fnt = m_statusLabel->font();
fnt.setBold( false );
fnt.setPointSize( fnt.pointSize() * 1 );
- label->setFont( fnt );
- gbox->addMultiCellWidget( label, 2, 2, 0, 0, AlignLeft | AlignVCenter );
+ m_statusLabel->setFont( fnt );
+ gbox->addMultiCellWidget( m_statusLabel, 2, 2, 0, 0, AlignLeft | AlignVCenter );
gbox->addLayout(centerbox, 0, 0);
gbox->addLayout(seperatorbox, 1, 0);
diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h
index 72db4b1b1..7ba93401f 100644
--- a/ksmserver/shutdowndlg.h
+++ b/ksmserver/shutdowndlg.h
@@ -87,11 +87,12 @@ public:
static void showit() { if ( s_pSelf != 0L ) s_pSelf->showNow(); }
static void stop() { if ( s_pSelf != 0L ) s_pSelf->fadeBack(); delete s_pSelf; s_pSelf = 0L; }
static KSMShutdownIPFeedback * self() { return s_pSelf; }
+ static bool ispainted() { if ( s_pSelf != 0L ) return s_pSelf->m_isPainted; else return false; }
protected:
~KSMShutdownIPFeedback();
-private slots:
+public slots:
void slotPaintEffect();
private:
@@ -104,6 +105,7 @@ private:
TQString pixmapName(int desk);
void enableExports();
int m_timeout;
+ bool m_isPainted;
};
// The confirmation dialog
@@ -139,12 +141,13 @@ private:
};
// The shutdown-in-progress dialog
-class KSMShutdownIPDlg : public TQDialog
+class KSMShutdownIPDlg : public TQWidget
{
Q_OBJECT
public:
static TQWidget* showShutdownIP();
+ void setStatusMessage(TQString message);
protected:
~KSMShutdownIPDlg();
@@ -154,6 +157,7 @@ protected slots:
private:
KSMShutdownIPDlg( TQWidget* parent );
+ TQLabel* m_statusLabel;
};
class KSMDelayedPushButton : public KPushButton