From 3cce16c2543ebd7441477b466b35c89333eef28c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 3 May 2013 15:55:11 -0500 Subject: Properly fix task tray background glitches Ensure session is fully locked before switching to new VT when lock is requested --- kdesktop/lock/lockprocess.cc | 19 +++++++++++++++++++ kdesktop/lock/lockprocess.h | 2 ++ kdesktop/lock/main.cc | 5 +++-- 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'kdesktop/lock') diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index e7b05d73c..33fd374aa 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -173,6 +173,7 @@ extern bool trinity_desktop_lock_hide_active_windows; extern bool trinity_desktop_lock_forced; extern bool argb_visual; +extern pid_t kdesktop_pid; extern TQXLibWindowList trinity_desktop_lock_hidden_window_list; @@ -224,6 +225,7 @@ LockProcess::LockProcess() mHackStartupEnabled(true), mOverrideHackStartupEnabled(false), mResizingDesktopLock(false), + mFullyOnlineSent(false), m_rootPixmap(NULL), mBackingStartupDelayTimer(0), m_startupStatusDialog(NULL), @@ -973,6 +975,8 @@ void LockProcess::createSaverWindow() } } + fullyOnline(); + kdDebug(1204) << "Saver window Id: " << winId() << endl; } @@ -2739,6 +2743,21 @@ void LockProcess::processInputPipeCommand(TQString inputcommand) { } } +void LockProcess::fullyOnline() { + if (!mFullyOnlineSent) { + if (kdesktop_pid > 0) { + if (kill(kdesktop_pid, SIGUSR2) < 0) { + // The controlling kdesktop process probably died. Commit suicide... + // Exit uncleanly + exit(1); + } + else { + mFullyOnlineSent = true; + } + } + } +} + //=========================================================================== // // Control pipe handler diff --git a/kdesktop/lock/lockprocess.h b/kdesktop/lock/lockprocess.h index 758297174..5b9649893 100644 --- a/kdesktop/lock/lockprocess.h +++ b/kdesktop/lock/lockprocess.h @@ -155,6 +155,7 @@ private: void windowAdded( WId window, bool managed ); void resume( bool force ); static TQVariant getConf(void *ctx, const char *key, const TQVariant &dflt); + void fullyOnline(); bool mLocked; int mLockGrace; @@ -220,6 +221,7 @@ private: bool mHackStartupEnabled; bool mOverrideHackStartupEnabled; bool mResizingDesktopLock; + bool mFullyOnlineSent; TQPixmap backingPixmap; KRootPixmap *m_rootPixmap; diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc index 792764da1..f6fbc20b2 100644 --- a/kdesktop/lock/main.cc +++ b/kdesktop/lock/main.cc @@ -81,6 +81,7 @@ bool signalled_run; bool in_internal_mode = FALSE; bool argb_visual = FALSE; +pid_t kdesktop_pid = -1; static void sigusr1_handler(int) { @@ -490,8 +491,8 @@ int main( int argc, char **argv ) return ret; } else { - pid_t kdesktop_pid = atoi(args->getOption( "internal" )); - if (kill(kdesktop_pid, SIGUSR2) < 0) { + kdesktop_pid = atoi(args->getOption( "internal" )); + if (kill(kdesktop_pid, 0) < 0) { // The controlling kdesktop process probably died. Commit suicide... return 12; } -- cgit v1.2.1