summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kdesktop/lock/lockprocess.cc69
-rw-r--r--kicker/taskbar/taskcontainer.cpp4
-rw-r--r--ksmserver/server.cpp10
-rw-r--r--ksmserver/server.h4
-rw-r--r--ksmserver/shutdown.cpp79
-rw-r--r--tdesu/tdesu/sudlg.cpp8
-rw-r--r--tdm/kfrontend/kgreeter.cpp10
7 files changed, 133 insertions, 51 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index 82952431a..1947793c9 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -130,6 +130,8 @@ Status DPMSInfo ( Display *, CARD16 *, BOOL * );
#define XF86XK_AudioLowerVolume 0x1008FF11
#define XF86XK_Display 0x1008FF59
+#define DPMS_MONITOR_BLANKED(x) ((x == DPMSModeStandby) || (x == DPMSModeSuspend) || (x == DPMSModeOff))
+
static Window gVRoot = 0;
static Window gVRootData = 0;
static Atom gXA_VROOT;
@@ -376,7 +378,7 @@ void LockProcess::init(bool child, bool useBlankOnly)
connect(&mSuspendTimer, TQT_SIGNAL(timeout()), TQT_SLOT(suspend()));
#ifdef HAVE_DPMS
- //if the user decided that the screensaver should run independent from
+ //if the user decided that the screensaver should run independent from
//dpms, we shouldn't check for it, aleXXX
if (KDesktopSettings::dpmsDependent()) {
BOOL on;
@@ -1436,15 +1438,34 @@ bool LockProcess::startLock()
void LockProcess::closeDialogAndStartHack()
{
- // Close any active dialogs
- DISABLE_CONTINUOUS_LOCKDLG_DISPLAY
- mSuspended = true;
- if (closeCurrentWindow()) {
- TQTimer::singleShot( 0, this, SLOT(closeDialogAndStartHack()) );
- }
- else {
- resume(true);
- }
+#ifdef HAVE_DPMS
+ if (KDesktopSettings::dpmsDependent()) {
+ BOOL on;
+ CARD16 state;
+ if (DPMSInfo(tqt_xdisplay(), &state, &on)) {
+ //kdDebug() << "checkDPMSActive " << on << " " << state << endl;
+ if (DPMS_MONITOR_BLANKED(state)) {
+ // Make sure saver will attempt to start again after DPMS wakeup
+ // This is related to Bug 1475
+ ENABLE_CONTINUOUS_LOCKDLG_DISPLAY
+ if (mHackStartupEnabled) mHackDelayStartupTimer->start(mHackDelayStartupTimeout, TRUE);
+ // Should not start saver here, because the DPMS check method below would turn it right back off!
+ // This is related to Bug 1475
+ return;
+ }
+ }
+ }
+#endif
+
+ // Close any active dialogs
+ DISABLE_CONTINUOUS_LOCKDLG_DISPLAY
+ mSuspended = true;
+ if (closeCurrentWindow()) {
+ TQTimer::singleShot( 0, this, SLOT(closeDialogAndStartHack()) );
+ }
+ else {
+ resume(true);
+ }
}
void LockProcess::repaintRootWindowIfNeeded()
@@ -2218,19 +2239,21 @@ void LockProcess::stayOnTop()
void LockProcess::checkDPMSActive()
{
#ifdef HAVE_DPMS
- BOOL on;
- CARD16 state;
- DPMSInfo(tqt_xdisplay(), &state, &on);
- //kdDebug() << "checkDPMSActive " << on << " " << state << endl;
- if (state == DPMSModeStandby || state == DPMSModeSuspend || state == DPMSModeOff)
- {
- suspend();
- } else if ( mSuspended )
- {
- if (mResizingDesktopLock == false) {
- resume( true );
- }
- }
+ if (KDesktopSettings::dpmsDependent()) {
+ BOOL on;
+ CARD16 state;
+ if (DPMSInfo(tqt_xdisplay(), &state, &on)) {
+ //kdDebug() << "checkDPMSActive " << on << " " << state << endl;
+ if (DPMS_MONITOR_BLANKED(state)) {
+ suspend();
+ }
+ else if (mSuspended) {
+ if (mResizingDesktopLock == false) {
+ resume( true );
+ }
+ }
+ }
+ }
#endif
}
diff --git a/kicker/taskbar/taskcontainer.cpp b/kicker/taskbar/taskcontainer.cpp
index d29321382..fa3b560a8 100644
--- a/kicker/taskbar/taskcontainer.cpp
+++ b/kicker/taskbar/taskcontainer.cpp
@@ -1258,7 +1258,9 @@ void TaskContainer::popupMenu(int action)
m_menu->installEventFilter( this );
m_menu->exec( pos );
- delete m_menu;
+ if (m_menu) {
+ delete m_menu;
+ }
m_menu = 0;
}
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index 9b49ac43c..780213897 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -928,6 +928,16 @@ bool KSMServer::isCM( const TQString& program ) const
return (program == "kompmgr");
}
+bool KSMServer::isNotifier( const KSMClient* client ) const
+{
+ return isNotifier( client->program());
+}
+
+bool KSMServer::isNotifier( const TQString& program ) const
+{
+ return (program == "knotify");
+}
+
bool KSMServer::defaultSession() const
{
return sessionGroup.isEmpty();
diff --git a/ksmserver/server.h b/ksmserver/server.h
index f90db4ae0..a59e708c6 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -142,11 +142,13 @@ private:
const TQString& clientMachine = TQString::null,
const TQString& userId = TQString::null );
void executeCommand( const TQStringList& command );
-
+
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 isNotifier( const KSMClient* client ) const;
+ bool isNotifier( const TQString& program ) const;
bool defaultSession() const; // empty session
void setupXIOErrorHandler();
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index 87b9836b1..05bfd0af2 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -95,6 +95,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "shutdowndlg.h"
#include "client.h"
+// #define PROFILE_SHUTDOWN 1
+
+#ifdef PROFILE_SHUTDOWN
+ #define SHUTDOWN_MARKER(x) printf("[ksmserver] '%s' [%s]\n\r", x, TQTime::currentTime().toString("hh:mm:ss:zzz").ascii()); fflush(stdout);
+#else // PROFILE_SHUTDOWN
+ #define SHUTDOWN_MARKER(x)
+#endif // PROFILE_SHUTDOWN
+
void KSMServer::logout( int confirm, int sdtype, int sdmode )
{
shutdown( (TDEApplication::ShutdownConfirm)confirm,
@@ -221,7 +229,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
}
if ( logoutConfirmed ) {
-
+ SHUTDOWN_MARKER("Shutdown initiated");
shutdownType = sdtype;
shutdownMode = sdmode;
bootOption = bopt;
@@ -230,8 +238,9 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
// shall we save the session on logout?
saveSession = ( config->readEntry( "loginMode", "restorePreviousLogout" ) == "restorePreviousLogout" );
- if ( saveSession )
+ if ( saveSession ) {
sessionGroup = TQString("Session: ") + SESSION_PREVIOUS_LOGOUT;
+ }
// Set the real desktop background to black so that exit looks
// clean regardless of what was on "our" desktop.
@@ -242,6 +251,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
wmPhase1WaitingCount = 0;
saveType = saveSession?SmSaveBoth:SmSaveGlobal;
performLegacySessionSave();
+ SHUTDOWN_MARKER("Legacy save complete");
startProtection();
for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
c->resetState();
@@ -271,8 +281,9 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm,
SmsSaveYourself( c->connection(), saveType,
true, SmInteractStyleAny, false );
}
- if ( clients.isEmpty() )
+ if ( clients.isEmpty() ) {
completeShutdownOrCheckpoint();
+ }
}
else {
if (showLogoutStatusDlg) {
@@ -505,12 +516,15 @@ void KSMServer::protectionTimeout()
void KSMServer::completeShutdownOrCheckpoint()
{
- if ( state != Shutdown && state != Checkpoint )
+ SHUTDOWN_MARKER("completeShutdownOrCheckpoint");
+ if ( state != Shutdown && state != Checkpoint ) {
return;
+ }
for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
- if ( !c->saveYourselfDone && !c->waitForPhase2 )
+ if ( !c->saveYourselfDone && !c->waitForPhase2 ) {
return; // not done yet
+ }
}
// do phase 2
@@ -522,8 +536,10 @@ void KSMServer::completeShutdownOrCheckpoint()
waitForPhase2 = true;
}
}
- if ( waitForPhase2 )
+ if ( waitForPhase2 ) {
return;
+ }
+ SHUTDOWN_MARKER("Phase 2 complete");
bool showLogoutStatusDlg = TDEConfigGroup(TDEGlobal::config(), "Logout").readBoolEntry("showLogoutStatusDlg", true);
if (showLogoutStatusDlg && state != Checkpoint) {
@@ -544,10 +560,14 @@ void KSMServer::completeShutdownOrCheckpoint()
static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Saving your settings..."));
}
- if ( saveSession )
+ if ( saveSession ) {
storeSession();
- else
+ SHUTDOWN_MARKER("Session stored");
+ }
+ else {
discardSession();
+ SHUTDOWN_MARKER("Session discarded");
+ }
if ( state == Shutdown ) {
bool waitForKNotify = true;
@@ -563,8 +583,9 @@ void KSMServer::completeShutdownOrCheckpoint()
}
// event() can return -1 if KNotifyClient short-circuits and avoids KNotify
logoutSoundEvent = KNotifyClient::event( 0, "exitkde" ); // KDE says good bye
- if( logoutSoundEvent <= 0 )
+ if( logoutSoundEvent <= 0 ) {
waitForKNotify = false;
+ }
if( waitForKNotify ) {
state = WaitingForKNotify;
knotifyTimeoutTimer.start( 20000, true );
@@ -577,15 +598,17 @@ void KSMServer::completeShutdownOrCheckpoint()
}
state = Idle;
}
+ SHUTDOWN_MARKER("Fully shutdown");
}
void KSMServer::startKilling()
{
+ SHUTDOWN_MARKER("startKilling");
knotifyTimeoutTimer.stop();
// kill all clients
state = Killing;
for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
- if( isWM( c ) || isCM( c ) ) // kill the WM and CM as the last one in order to reduce flicker
+ if( isWM( c ) || isCM( c ) || isNotifier( c ) ) // kill the WM and CM as the last one in order to reduce flicker. Also wait to kill knotify to avoid logout delays
continue;
kdDebug( 1218 ) << "completeShutdown: client " << c->program() << "(" << c->clientId() << ")" << endl;
SmsDie( c->connection() );
@@ -599,12 +622,13 @@ void KSMServer::startKilling()
void KSMServer::completeKilling()
{
+ SHUTDOWN_MARKER("completeKilling");
kdDebug( 1218 ) << "KSMServer::completeKilling clients.count()=" <<
clients.count() << endl;
if( state == Killing ) {
bool wait = false;
for( KSMClient* c = clients.first(); c; c = clients.next()) {
- if( isWM( c ) || isCM( c ) )
+ if( isWM( c ) || isCM( c ) || isNotifier( c ) )
continue;
wait = true; // still waiting for clients to go away
}
@@ -616,6 +640,7 @@ void KSMServer::completeKilling()
void KSMServer::killWM()
{
+ SHUTDOWN_MARKER("killWM");
state = KillingWM;
bool iswm = false;
if (shutdownNotifierIPDlg) {
@@ -631,6 +656,9 @@ void KSMServer::killWM()
if( isCM( c )) {
SmsDie( c->connection() );
}
+ if( isNotifier( c )) {
+ SmsDie( c->connection() );
+ }
}
if( iswm ) {
completeKillingWM();
@@ -642,6 +670,7 @@ void KSMServer::killWM()
void KSMServer::completeKillingWM()
{
+ SHUTDOWN_MARKER("completeKillingWM");
kdDebug( 1218 ) << "KSMServer::completeKillingWM clients.count()=" <<
clients.count() << endl;
if( state == KillingWM ) {
@@ -653,18 +682,26 @@ void KSMServer::completeKillingWM()
// shutdown is fully complete
void KSMServer::killingCompleted()
{
+ SHUTDOWN_MARKER("killingCompleted");
kapp->quit();
}
// called when KNotify performs notification for logout (not when sound is finished though)
void KSMServer::notifySlot(TQString event ,TQString app,TQString,TQString,TQString,int present,int,int,int)
{
- if( state != WaitingForKNotify )
+ SHUTDOWN_MARKER("notifySlot");
+ if( state != WaitingForKNotify ) {
+ SHUTDOWN_MARKER("notifySlot state != WaitingForKNotify");
return;
- if( event != "exitkde" || app != "ksmserver" )
+ }
+ if( event != "exitkde" || app != "ksmserver" ) {
+ SHUTDOWN_MARKER("notifySlot event != \"exitkde\" || app != \"ksmserver\"");
return;
- if( present & KNotifyClient::Sound ) // logoutSoundFinished() will be called
+ }
+ if( present & KNotifyClient::Sound ) { // logoutSoundFinished() will be called
+ SHUTDOWN_MARKER("notifySlot present & KNotifyClient::Sound");
return;
+ }
startKilling();
}
@@ -672,23 +709,30 @@ void KSMServer::notifySlot(TQString event ,TQString app,TQString,TQString,TQStri
// emitted in KNotify only after the sound is finished playing.
void KSMServer::logoutSoundFinished( int event, int )
{
- if( state != WaitingForKNotify )
+ SHUTDOWN_MARKER("logoutSoundFinished");
+ if( state != WaitingForKNotify ) {
return;
- if( event != logoutSoundEvent )
+ }
+ if( event != logoutSoundEvent ) {
return;
+ }
startKilling();
}
void KSMServer::knotifyTimeout()
{
- if( state != WaitingForKNotify )
+ SHUTDOWN_MARKER("knotifyTimeout");
+ if( state != WaitingForKNotify ) {
return;
+ }
startKilling();
}
void KSMServer::timeoutQuit()
{
+ SHUTDOWN_MARKER("timeoutQuit");
for (KSMClient *c = clients.first(); c; c = clients.next()) {
+ SHUTDOWN_MARKER(TQString("SmsDie timeout, client %1 (%2)").arg(c->program()).arg(c->clientId()).ascii());
kdWarning( 1218 ) << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" << endl;
}
killWM();
@@ -696,6 +740,7 @@ void KSMServer::timeoutQuit()
void KSMServer::timeoutWMQuit()
{
+ SHUTDOWN_MARKER("timeoutWMQuit");
if( state == KillingWM ) {
kdWarning( 1218 ) << "SmsDie WM timeout" << endl;
}
diff --git a/tdesu/tdesu/sudlg.cpp b/tdesu/tdesu/sudlg.cpp
index 713409631..e24bf325e 100644
--- a/tdesu/tdesu/sudlg.cpp
+++ b/tdesu/tdesu/sudlg.cpp
@@ -15,7 +15,7 @@
#include "sudlg.h"
KDEsuDialog::KDEsuDialog(TQCString user, TQCString auth_user, bool enableKeep,const TQString& icon, bool withIgnoreButton, int timeout)
- : KPasswordDialog(Password, enableKeep, (withIgnoreButton ? User1:NoDefault), icon)
+ : KPasswordDialog(Password, enableKeep, 0, icon)
{
TDEConfig* config = TDEGlobal::config();
config->setGroup("super-user-command");
@@ -34,12 +34,10 @@ KDEsuDialog::KDEsuDialog(TQCString user, TQCString auth_user, bool enableKeep,co
} else {
if (m_User == "root") {
prompt = i18n("The action you requested needs root privileges. "
- "Please enter root's password below or click "
- "Ignore to continue with your current privileges.");
+ "Please enter root's password below.");
} else {
prompt = i18n("The action you requested needs additional privileges. "
- "Please enter the password for \"%1\" below or click "
- "Ignore to continue with your current privileges.").arg(static_cast<const char *>(m_User));
+ "Please enter the password for \"%1\" below.").arg(static_cast<const char *>(m_User));
}
}
setPrompt(prompt);
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp
index bffcc5d6d..0d89b065c 100644
--- a/tdm/kfrontend/kgreeter.cpp
+++ b/tdm/kfrontend/kgreeter.cpp
@@ -663,10 +663,12 @@ void // private
KGreeter::setPrevWM( int wm )
{
if (curPrev != wm) {
- if (curPrev != -1)
+ if (curPrev != -1) {
sessMenu->changeItem( curPrev, sessionTypes[curPrev].name );
- if (wm != -1)
+ }
+ if (wm != -1) {
sessMenu->changeItem( wm, sessionTypes[wm].name + i18n(" (previous)") );
+ }
curPrev = wm;
}
}
@@ -802,7 +804,6 @@ KGreeter::verifyOk()
GSendInt( G_PutDmrc );
GSendStr( "Session" );
GSendStr( "default" );
- curWMSession = sessionTypes[curSel].type.utf8();
}
GSendInt( G_Ready );
closingDown = true;
@@ -812,8 +813,9 @@ KGreeter::verifyOk()
void
KGreeter::verifyFailed()
{
- if (needLoad)
+ if (needLoad) {
slotLoadPrevWM();
+ }
}
void