summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ksmserver/server.cpp14
-rw-r--r--ksmserver/server.h2
-rw-r--r--ksmserver/shutdown.cpp22
-rw-r--r--ksmserver/shutdowndlg.cpp36
-rw-r--r--ksmserver/shutdowndlg.h3
-rw-r--r--tdeioslave/thumbnail/thumbnail.cpp4
-rw-r--r--tdmlib/dmctl.cpp10
-rw-r--r--tdmlib/dmctl.h6
8 files changed, 81 insertions, 16 deletions
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index 214108fb4..6e3ed44a3 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -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());
diff --git a/ksmserver/server.h b/ksmserver/server.h
index 00e3b7388..f850c747c 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -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
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index 4f064ece3..5809cd295 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -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)
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index ad2d9113f..b30e6ec2e 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -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);
diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h
index e9f2271e3..3ce851244 100644
--- a/ksmserver/shutdowndlg.h
+++ b/ksmserver/shutdowndlg.h
@@ -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
diff --git a/tdeioslave/thumbnail/thumbnail.cpp b/tdeioslave/thumbnail/thumbnail.cpp
index 764f89937..e5c67ec0d 100644
--- a/tdeioslave/thumbnail/thumbnail.cpp
+++ b/tdeioslave/thumbnail/thumbnail.cpp
@@ -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";
diff --git a/tdmlib/dmctl.cpp b/tdmlib/dmctl.cpp
index cd970c5e6..9cf7e9d34 100644
--- a/tdmlib/dmctl.cpp
+++ b/tdmlib/dmctl.cpp
@@ -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
diff --git a/tdmlib/dmctl.h b/tdmlib/dmctl.h
index 4fdb8fb5b..376a9ddd7 100644
--- a/tdmlib/dmctl.h
+++ b/tdmlib/dmctl.h
@@ -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