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
v3.5.13-sru
tpearson 13 years ago
parent 29570c5acb
commit 1f40ada72d

@ -43,5 +43,5 @@ tde_add_kdeinit_executable( ksmserver AUTOMOC
main.cpp server.cpp shutdowndlg.cpp main.cpp server.cpp shutdowndlg.cpp
legacy.cpp startup.cpp shutdown.cpp client.cpp legacy.cpp startup.cpp shutdown.cpp client.cpp
KSMServerInterface.skel server.skel timed.ui 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}
) )

@ -913,7 +913,18 @@ bool KSMServer::isWM( const TQString& program ) const
// therefore make sure it's recognized even if ksmserver // therefore make sure it's recognized even if ksmserver
// was initially started with different WM, and kwin replaced // was initially started with different WM, and kwin replaced
// it later // 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 bool KSMServer::defaultSession() const

@ -145,6 +145,8 @@ private:
bool isWM( const KSMClient* client ) const; bool isWM( const KSMClient* client ) const;
bool isWM( const TQString& program ) const; bool isWM( const TQString& program ) const;
bool isCM( const KSMClient* client ) const;
bool isCM( const TQString& program ) const;
bool defaultSession() const; // empty session bool defaultSession() const; // empty session
void setupXIOErrorHandler(); void setupXIOErrorHandler();

@ -81,6 +81,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <kdebug.h> #include <kdebug.h>
#include <knotifyclient.h> #include <knotifyclient.h>
#include <libkrsync/krsync.h>
#include "server.h" #include "server.h"
#include "global.h" #include "global.h"
#include "shutdowndlg.h" #include "shutdowndlg.h"
@ -182,6 +184,7 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
shutdownType = sdtype; shutdownType = sdtype;
shutdownMode = sdmode; shutdownMode = sdmode;
bootOption = bopt; bootOption = bopt;
shutdownNotifierIPDlg = 0;
// 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" );
@ -189,6 +192,19 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
if (showFancyLogout) { if (showFancyLogout) {
KSMShutdownIPFeedback::showit(); // hide the UGLY logout process from the user KSMShutdownIPFeedback::showit(); // hide the UGLY logout process from the user
shutdownNotifierIPDlg = KSMShutdownIPDlg::showShutdownIP(); 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 ) if ( saveSession )
@ -196,7 +212,9 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
// Set the real desktop background to black so that exit looks // Set the real desktop background to black so that exit looks
// clean regardless of what was on "our" desktop. // 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; state = Shutdown;
wmPhase1WaitingCount = 0; wmPhase1WaitingCount = 0;
saveType = saveSession?SmSaveBoth:SmSaveGlobal; saveType = saveSession?SmSaveBoth:SmSaveGlobal;
@ -520,7 +538,7 @@ void KSMServer::startKilling()
// kill all clients // kill all clients
state = Killing; state = Killing;
for ( KSMClient* c = clients.first(); c; c = clients.next() ) { 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; continue;
kdDebug( 1218 ) << "completeShutdown: client " << c->program() << "(" << c->clientId() << ")" << endl; kdDebug( 1218 ) << "completeShutdown: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() ); SmsDie( c->connection() );
@ -539,7 +557,7 @@ void KSMServer::completeKilling()
if( state == Killing ) { if( state == Killing ) {
bool wait = false; bool wait = false;
for( KSMClient* c = clients.first(); c; c = clients.next()) { for( KSMClient* c = clients.first(); c; c = clients.next()) {
if( isWM( c )) if( isWM( c ) || isCM( c ) )
continue; continue;
wait = true; // still waiting for clients to go away 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; kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() ); SmsDie( c->connection() );
} }
if( isCM( c )) {
SmsDie( c->connection() );
}
} }
if( iswm ) { if( iswm ) {
completeKillingWM(); completeKillingWM();

@ -516,19 +516,18 @@ void KSMShutdownFeedback::slotPaintEffect()
KSMShutdownIPFeedback * KSMShutdownIPFeedback::s_pSelf = 0L; KSMShutdownIPFeedback * KSMShutdownIPFeedback::s_pSelf = 0L;
KSMShutdownIPFeedback::KSMShutdownIPFeedback() 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 // Try to get the root pixmap
system("krootbacking &"); system("krootbacking &");
resize(0, 0);
setShown(true);
} }
void KSMShutdownIPFeedback::showNow() void KSMShutdownIPFeedback::showNow()
{ {
// slotPaintEffect();
TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) ); TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) );
} }
@ -588,11 +587,15 @@ void KSMShutdownIPFeedback::slotPaintEffect()
pm.convertFromImage(correctedImage); pm.convertFromImage(correctedImage);
} }
resize(kapp->desktop()->width(), kapp->desktop()->height()); setBackgroundPixmap( pm );
move(0,0); move(0,0);
setShown(true); setWindowState(WindowFullScreen);
setGeometry( TQApplication::desktop()->geometry() );
setBackgroundPixmap( pm ); repaint(true);
tqApp->flushX();
m_isPainted = true;
} }
void KSMShutdownIPFeedback::enableExports() void KSMShutdownIPFeedback::enableExports()
@ -1106,22 +1109,25 @@ TQWidget* KSMShutdownIPDlg::showShutdownIP()
l->move(rect.x() + (rect.width() - sh.width())/2, l->move(rect.x() + (rect.width() - sh.width())/2,
rect.y() + (rect.height() - sh.height())/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(); kapp->disableStyles();
return l; 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) 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 // Signal that we do not want any window controls to be shown at all
Atom kde_wm_system_modal_notification; Atom kde_wm_system_modal_notification;
kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); 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 ); label->setFont( fnt );
centerbox->addWidget( label, AlignCenter ); centerbox->addWidget( label, AlignCenter );
label = new TQLabel( i18n("Saving your settings..."), frame ); m_statusLabel = new TQLabel( i18n("Saving your settings..."), frame );
fnt = label->font(); fnt = m_statusLabel->font();
fnt.setBold( false ); fnt.setBold( false );
fnt.setPointSize( fnt.pointSize() * 1 ); fnt.setPointSize( fnt.pointSize() * 1 );
label->setFont( fnt ); m_statusLabel->setFont( fnt );
gbox->addMultiCellWidget( label, 2, 2, 0, 0, AlignLeft | AlignVCenter ); gbox->addMultiCellWidget( m_statusLabel, 2, 2, 0, 0, AlignLeft | AlignVCenter );
gbox->addLayout(centerbox, 0, 0); gbox->addLayout(centerbox, 0, 0);
gbox->addLayout(seperatorbox, 1, 0); gbox->addLayout(seperatorbox, 1, 0);

@ -87,11 +87,12 @@ public:
static void showit() { if ( s_pSelf != 0L ) s_pSelf->showNow(); } 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 void stop() { if ( s_pSelf != 0L ) s_pSelf->fadeBack(); delete s_pSelf; s_pSelf = 0L; }
static KSMShutdownIPFeedback * self() { return s_pSelf; } static KSMShutdownIPFeedback * self() { return s_pSelf; }
static bool ispainted() { if ( s_pSelf != 0L ) return s_pSelf->m_isPainted; else return false; }
protected: protected:
~KSMShutdownIPFeedback(); ~KSMShutdownIPFeedback();
private slots: public slots:
void slotPaintEffect(); void slotPaintEffect();
private: private:
@ -104,6 +105,7 @@ private:
TQString pixmapName(int desk); TQString pixmapName(int desk);
void enableExports(); void enableExports();
int m_timeout; int m_timeout;
bool m_isPainted;
}; };
// The confirmation dialog // The confirmation dialog
@ -139,12 +141,13 @@ private:
}; };
// The shutdown-in-progress dialog // The shutdown-in-progress dialog
class KSMShutdownIPDlg : public TQDialog class KSMShutdownIPDlg : public TQWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
static TQWidget* showShutdownIP(); static TQWidget* showShutdownIP();
void setStatusMessage(TQString message);
protected: protected:
~KSMShutdownIPDlg(); ~KSMShutdownIPDlg();
@ -154,6 +157,7 @@ protected slots:
private: private:
KSMShutdownIPDlg( TQWidget* parent ); KSMShutdownIPDlg( TQWidget* parent );
TQLabel* m_statusLabel;
}; };
class KSMDelayedPushButton : public KPushButton class KSMDelayedPushButton : public KPushButton

@ -610,7 +610,7 @@ void Client::hideClient( bool hide )
updateVisibility(); updateVisibility();
} }
/* /*!
Returns whether the window is minimizable or not Returns whether the window is minimizable or not
*/ */
bool Client::isMinimizable() const bool Client::isMinimizable() const
@ -643,6 +643,16 @@ bool Client::isMinimizable() const
return true; return true;
} }
/*!
Returns whether the window is kept above or not
*/
bool Client::keepAbove() const
{
if( isModalSystemNotification())
return true;
return keep_above;
}
/*! /*!
Minimizes this client plus its transients Minimizes this client plus its transients
*/ */

@ -792,11 +792,6 @@ inline bool Client::skipPager() const
return skip_pager; return skip_pager;
} }
inline bool Client::keepAbove() const
{
return keep_above;
}
inline bool Client::keepBelow() const inline bool Client::keepBelow() const
{ {
return keep_below; return keep_below;

Loading…
Cancel
Save