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;
}
if (kapp)
if (kapp) {
kapp->quit();
}
//::exit(0);
}
@ -945,6 +946,17 @@ bool KSMServer::isCM( const TQString& program ) const
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
{
return isNotifier( client->program());

@ -149,6 +149,8 @@ private:
bool isWM( const TQString& program ) const;
bool isCM( const KSMClient* client ) 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 TQString& program ) const;
bool defaultSession() const; // empty session

@ -706,15 +706,17 @@ void KSMServer::killWM()
shutdownNotifierIPDlg=0;
}
for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
if( isWM( c )) {
if( isNotifier( c )) {
iswm = true;
kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() );
}
if( isCM( c )) {
iswm = true;
SmsDie( c->connection() );
}
if( isNotifier( c )) {
if( isWM( c )) {
iswm = true;
kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() );
}
}
@ -742,7 +744,19 @@ void KSMServer::completeKillingWM()
void KSMServer::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)

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

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

@ -187,7 +187,7 @@ void ThumbnailProtocol::get(const KURL &url)
#ifdef THUMBNAIL_HACK
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_height=128;
iconSize=128;
@ -232,7 +232,7 @@ void ThumbnailProtocol::get(const KURL &url)
}
}
ThumbCreator::Flags flags = ThumbCreator::None;
if (!kfmiThumb)
{
kdDebug(7115) << "using thumb creator for the thumbnail\n";

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

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

Loading…
Cancel
Save