Beautify logout process

pull/2/head
Timothy Pearson 11 years ago
parent d41051b3a2
commit 1eb5bc8165

@ -514,8 +514,9 @@ static void sighandler(int sig)
delete server; delete server;
} }
if (kapp) if (kapp) {
kapp->quit(); kapp->quit();
}
//::exit(0); //::exit(0);
} }
@ -945,6 +946,17 @@ bool KSMServer::isCM( const TQString& program ) const
return (program == "kompmgr"); return (program == "kompmgr");
} }
bool KSMServer::isDesktop( const KSMClient* client ) const
{
return isDesktop( client->program());
}
bool KSMServer::isDesktop( const TQString& program ) const
{
// Returns true if the program in question is a desktop
return (program == "kdesktop");
}
bool KSMServer::isNotifier( const KSMClient* client ) const bool KSMServer::isNotifier( const KSMClient* client ) const
{ {
return isNotifier( client->program()); return isNotifier( client->program());

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

@ -706,15 +706,17 @@ void KSMServer::killWM()
shutdownNotifierIPDlg=0; shutdownNotifierIPDlg=0;
} }
for ( KSMClient* c = clients.first(); c; c = clients.next() ) { for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
if( isWM( c )) { if( isNotifier( c )) {
iswm = true; iswm = true;
kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() ); SmsDie( c->connection() );
} }
if( isCM( c )) { if( isCM( c )) {
iswm = true;
SmsDie( c->connection() ); SmsDie( c->connection() );
} }
if( isNotifier( c )) { if( isWM( c )) {
iswm = true;
kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() ); SmsDie( c->connection() );
} }
} }
@ -742,7 +744,19 @@ void KSMServer::completeKillingWM()
void KSMServer::killingCompleted() void KSMServer::killingCompleted()
{ {
SHUTDOWN_MARKER("killingCompleted"); SHUTDOWN_MARKER("killingCompleted");
kapp->quit(); DM dmObject;
int dmType = dmObject.type();
if ((dmType == DM::NewTDM) || (dmType == DM::OldTDM) || (dmType == DM::GDM)) {
// Hide any remaining windows until the X server is terminated by the display manager
pid_t child;
child = fork();
if (child != 0) {
kapp->quit();
}
}
else {
kapp->quit();
}
} }
// called when KNotify performs notification for logout (not when sound is finished though) // called when KNotify performs notification for logout (not when sound is finished though)

@ -519,7 +519,7 @@ void KSMShutdownFeedback::slotPaintEffect()
KSMShutdownIPFeedback * KSMShutdownIPFeedback::s_pSelf = 0L; KSMShutdownIPFeedback * KSMShutdownIPFeedback::s_pSelf = 0L;
KSMShutdownIPFeedback::KSMShutdownIPFeedback() 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_paintedFromSharedRootPixmap(false), m_sharedRootPixmap(NULL), mPixmapTimeout(0)
{ {
setShown(false); setShown(false);
@ -559,7 +559,10 @@ void KSMShutdownIPFeedback::showNow()
{ {
setShown(true); setShown(true);
TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) ); if (!m_isPainted) {
setGeometry( TQApplication::desktop()->geometry() );
TQTimer::singleShot( 0, this, SLOT(slotPaintEffect()) );
}
} }
void KSMShutdownIPFeedback::enableExports() void KSMShutdownIPFeedback::enableExports()
@ -588,12 +591,19 @@ KSMShutdownIPFeedback::~KSMShutdownIPFeedback()
if (m_sharedRootPixmap) { if (m_sharedRootPixmap) {
m_sharedRootPixmap->stop(); m_sharedRootPixmap->stop();
delete m_sharedRootPixmap; delete m_sharedRootPixmap;
m_sharedRootPixmap = NULL;
} }
} }
void KSMShutdownIPFeedback::fadeBack( void ) void KSMShutdownIPFeedback::fadeBack( void ) {
{ //
}
void KSMShutdownIPFeedback::resizeEvent(TQResizeEvent* re) {
if (m_isPainted) {
// Resist all attempts to change size
setGeometry( m_screenGeometry );
}
} }
void KSMShutdownIPFeedback::slotSetBackgroundPixmap(const TQPixmap &rpm) { void KSMShutdownIPFeedback::slotSetBackgroundPixmap(const TQPixmap &rpm) {
@ -602,6 +612,10 @@ void KSMShutdownIPFeedback::slotSetBackgroundPixmap(const TQPixmap &rpm) {
void KSMShutdownIPFeedback::slotPaintEffect() void KSMShutdownIPFeedback::slotPaintEffect()
{ {
if (m_isPainted && m_paintedFromSharedRootPixmap) {
return;
}
TQPixmap pm = m_rootPixmap; TQPixmap pm = m_rootPixmap;
if (mPixmapTimeout == 0) { if (mPixmapTimeout == 0) {
if (TQPaintDevice::x11AppDepth() != 32) { if (TQPaintDevice::x11AppDepth() != 32) {
@ -630,6 +644,15 @@ void KSMShutdownIPFeedback::slotPaintEffect()
else { else {
pm = TQPixmap(kapp->desktop()->width(), kapp->desktop()->height()); pm = TQPixmap(kapp->desktop()->width(), kapp->desktop()->height());
pm.fill(Qt::black); pm.fill(Qt::black);
m_paintedFromSharedRootPixmap = false;
}
}
else {
m_paintedFromSharedRootPixmap = true;
if (m_sharedRootPixmap) {
m_sharedRootPixmap->stop();
delete m_sharedRootPixmap;
m_sharedRootPixmap = NULL;
} }
} }
@ -657,7 +680,8 @@ void KSMShutdownIPFeedback::slotPaintEffect()
setBackgroundPixmap( pm ); setBackgroundPixmap( pm );
move(0,0); move(0,0);
setWindowState(WindowFullScreen); setWindowState(WindowFullScreen);
setGeometry( TQApplication::desktop()->geometry() ); m_screenGeometry = TQApplication::desktop()->geometry();
setGeometry( m_screenGeometry );
repaint(true); repaint(true);
tqApp->flushX(); tqApp->flushX();
@ -1222,8 +1246,6 @@ void KSMDelayedPushButton::slotReleased()
void KSMDelayedPushButton::slotTimeout() void KSMDelayedPushButton::slotTimeout()
{ {
TQPoint bl = mapToGlobal(rect().bottomLeft()); TQPoint bl = mapToGlobal(rect().bottomLeft());
TQWidget *par = (TQWidget*)parent();
TQPoint br = par->mapToGlobal(par->rect().bottomRight());
pop->popup( bl ); pop->popup( bl );
popt->stop(); popt->stop();
setDown(false); setDown(false);

@ -97,6 +97,7 @@ public:
protected: protected:
~KSMShutdownIPFeedback(); ~KSMShutdownIPFeedback();
virtual void resizeEvent(TQResizeEvent* re);
public slots: public slots:
void slotPaintEffect(); void slotPaintEffect();
@ -118,9 +119,11 @@ private:
void showNow( void ); void showNow( void );
int m_timeout; int m_timeout;
bool m_isPainted; bool m_isPainted;
bool m_paintedFromSharedRootPixmap;
KRootPixmap* m_sharedRootPixmap; KRootPixmap* m_sharedRootPixmap;
TQPixmap m_rootPixmap; TQPixmap m_rootPixmap;
int mPixmapTimeout; int mPixmapTimeout;
TQRect m_screenGeometry;
}; };
// The confirmation dialog // The confirmation dialog

@ -187,7 +187,7 @@ void ThumbnailProtocol::get(const KURL &url)
#ifdef THUMBNAIL_HACK #ifdef THUMBNAIL_HACK
else if (!m_width || !m_height) else if (!m_width || !m_height)
{ {
kdDebug(7115) << "Guessing height, width, icon sizre!" << endl; kdDebug(7115) << "Guessing height, width, icon size!" << endl;
m_width=128; m_width=128;
m_height=128; m_height=128;
iconSize=128; iconSize=128;
@ -232,7 +232,7 @@ void ThumbnailProtocol::get(const KURL &url)
} }
} }
ThumbCreator::Flags flags = ThumbCreator::None; ThumbCreator::Flags flags = ThumbCreator::None;
if (!kfmiThumb) if (!kfmiThumb)
{ {
kdDebug(7115) << "using thumb creator for the thumbnail\n"; kdDebug(7115) << "using thumb creator for the thumbnail\n";

@ -37,7 +37,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
static enum { Dunno, NoDM, NewTDM, OldTDM, GDM } DMType = Dunno; static int DMType = DM::Unknown;
static const char *ctl, *dpy; static const char *ctl, *dpy;
DM::DM() : fd( -1 ) DM::DM() : fd( -1 )
@ -45,7 +45,7 @@ DM::DM() : fd( -1 )
char *ptr; char *ptr;
struct sockaddr_un sa; struct sockaddr_un sa;
if (DMType == Dunno) { if (DMType == Unknown) {
if (!(dpy = ::getenv( "DISPLAY" ))) if (!(dpy = ::getenv( "DISPLAY" )))
DMType = NoDM; DMType = NoDM;
else if ((ctl = ::getenv( "DM_CONTROL" ))) else if ((ctl = ::getenv( "DM_CONTROL" )))
@ -439,4 +439,10 @@ DM::GDMAuthenticate()
fclose (fp); fclose (fp);
} }
int
DM::type()
{
return DMType;
}
#endif // Q_WS_X11 #endif // Q_WS_X11

@ -39,6 +39,8 @@ public:
DM(); DM();
~DM(); ~DM();
enum { Unknown, NoDM, NewTDM, OldTDM, GDM };
bool canShutdown(); bool canShutdown();
void shutdown( TDEApplication::ShutdownType shutdownType, void shutdown( TDEApplication::ShutdownType shutdownType,
TDEApplication::ShutdownMode shutdownMode, TDEApplication::ShutdownMode shutdownMode,
@ -58,6 +60,8 @@ public:
static TQString sess2Str( const SessEnt &se ); static TQString sess2Str( const SessEnt &se );
static void sess2Str2( const SessEnt &se, TQString &user, TQString &loc ); static void sess2Str2( const SessEnt &se, TQString &user, TQString &loc );
int type();
private: private:
int fd; int fd;
@ -86,6 +90,8 @@ public:
bool bootOptions( TQStringList &opts, int &dflt, int &curr ); bool bootOptions( TQStringList &opts, int &dflt, int &curr );
int type() { return NoDM }
#endif // Q_WS_X11 #endif // Q_WS_X11
}; // class DM }; // class DM

Loading…
Cancel
Save