diff options
Diffstat (limited to 'kdesktop')
-rw-r--r-- | kdesktop/lock/lockdlg.cc | 11 | ||||
-rw-r--r-- | kdesktop/lock/lockprocess.cc | 31 | ||||
-rw-r--r-- | kdesktop/lock/lockprocess.h | 4 | ||||
-rw-r--r-- | kdesktop/lock/main.cc | 23 |
4 files changed, 55 insertions, 14 deletions
diff --git a/kdesktop/lock/lockdlg.cc b/kdesktop/lock/lockdlg.cc index 1ae046520..6081ea0f8 100644 --- a/kdesktop/lock/lockdlg.cc +++ b/kdesktop/lock/lockdlg.cc @@ -225,8 +225,15 @@ void PasswordDlg::init(GreeterPluginHandle *plugin) DCOPRef kxkb("kxkb", "kxkb"); if( !kxkb.isNull() ) { - layoutsList = kxkb.call("getLayoutsList"); - TQString currentLayout = kxkb.call("getCurrentLayout"); + DCOPReply reply = kxkb.call("getLayoutsList"); + if (reply.isValid()) { + layoutsList = reply; + } + reply = kxkb.call("getCurrentLayout"); + TQString currentLayout; + if (reply.isValid()) { + reply.get(currentLayout); + } if( !currentLayout.isEmpty() && layoutsList.count() > 1 ) { currLayout = layoutsList.find(currentLayout); if (currLayout == layoutsList.end()) diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index 479db1e6b..a0600f893 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -156,12 +156,10 @@ trinity_desktop_lock_autohide_lockdlg = TRUE; // Screen saver handling process. Handles screensaver window, // starting screensaver hacks, and password entry. // -LockProcess::LockProcess(bool child, bool useBlankOnly) +LockProcess::LockProcess() : TQWidget(0L, "saver window", (trinity_desktop_lock_use_system_modal_dialogs?((WFlags)(WStyle_StaysOnTop|WStyle_Customize|WStyle_NoBorder)):((WFlags)WX11BypassWM))), mOpenGLVisual(0), - child_saver(child), mParent(0), - mUseBlankOnly(useBlankOnly), mShowLockDateTime(false), mSuspended(false), mVisibility(false), @@ -200,9 +198,6 @@ LockProcess::LockProcess(bool child, bool useBlankOnly) setupSignals(); setupPipe(); - mShowLockDateTime = KDesktopSettings::showLockDateTime(); - mlockDateTime = TQDateTime::currentDateTime(); - kapp->installX11EventFilter(this); mForceContinualLockDisplayTimer = new TQTimer( this ); @@ -216,8 +211,11 @@ LockProcess::LockProcess(bool child, bool useBlankOnly) connect(tqApp, TQT_SIGNAL(mouseInteraction(XEvent *)), TQT_SLOT(slotMouseActivity(XEvent *))); - mHackDelayStartupTimeout = trinity_desktop_lock_delay_screensaver_start?KDesktopSettings::timeout()*1000:10*1000; - mHackStartupEnabled = trinity_desktop_lock_delay_screensaver_start?KDesktopSettings::screenSaverEnabled():true; + // Try to get the root pixmap + if (!m_rootPixmap) m_rootPixmap = new KRootPixmap(this); + m_rootPixmap->setCustomPainting(true); + connect(m_rootPixmap, TQT_SIGNAL(backgroundUpdated(const TQPixmap &)), this, TQT_SLOT(slotPaintBackground(const TQPixmap &))); + m_rootPixmap->start(); // Get root window size XWindowAttributes rootAttr; @@ -341,6 +339,23 @@ LockProcess::~LockProcess() mPipeOpen_out = false; } +//--------------------------------------------------------------------------- +// +// Initialization for startup +// This is where instance settings should be set--all objects should have already been created in the constructor above +// +void LockProcess::init(bool child, bool useBlankOnly) +{ + child_saver = child; + mUseBlankOnly = useBlankOnly; + + mShowLockDateTime = KDesktopSettings::showLockDateTime(); + mlockDateTime = TQDateTime::currentDateTime(); + + mHackDelayStartupTimeout = trinity_desktop_lock_delay_screensaver_start?KDesktopSettings::timeout()*1000:10*1000; + mHackStartupEnabled = trinity_desktop_lock_delay_screensaver_start?KDesktopSettings::screenSaverEnabled():true; +} + static int signal_pipe[2]; static void sigterm_handler(int) diff --git a/kdesktop/lock/lockprocess.h b/kdesktop/lock/lockprocess.h index 18320a8a1..754151027 100644 --- a/kdesktop/lock/lockprocess.h +++ b/kdesktop/lock/lockprocess.h @@ -48,9 +48,11 @@ class LockProcess { Q_OBJECT public: - LockProcess(bool child_saver = false, bool useBlankOnly = false); + LockProcess(); ~LockProcess(); + void init(bool child_saver = false, bool useBlankOnly = false); + bool lock(); bool defaultSave(); diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc index 896defd10..4dc9f1e0a 100644 --- a/kdesktop/lock/main.cc +++ b/kdesktop/lock/main.cc @@ -201,7 +201,6 @@ int main( int argc, char **argv ) trinity_desktop_lock_use_system_modal_dialogs = !KDesktopSettings::useUnmanagedLockWindows(); trinity_desktop_lock_delay_screensaver_start = KDesktopSettings::delaySaverStart(); - // RAJA struct stat st; KSimpleConfig* tdmconfig; if( stat( KDE_CONFDIR "/tdm/tdmdistrc" , &st ) == 0) { @@ -212,7 +211,11 @@ int main( int argc, char **argv ) } tdmconfig->setGroup("X-*-Greeter"); trinity_desktop_lock_use_sak = tdmconfig->readBoolEntry("UseSAK", true); - delete tdmconfig; + + LockProcess process; + + // Start loading core functions, such as the desktop wallpaper interface + app.processEvents(); if (args->isSet( "internal" )) { while (signalled_run == FALSE) { @@ -265,11 +268,25 @@ int main( int argc, char **argv ) } } + // Reload settings to make sure they reflect reality + KDesktopSettings::self()->readConfig(); + tdmconfig->reparseConfiguration(); + trinity_desktop_lock_use_system_modal_dialogs = !KDesktopSettings::useUnmanagedLockWindows(); + trinity_desktop_lock_delay_screensaver_start = KDesktopSettings::delaySaverStart(); + if (trinity_desktop_lock_use_system_modal_dialogs) { + trinity_desktop_lock_use_sak = tdmconfig->readBoolEntry("UseSAK", true); + } + else { + trinity_desktop_lock_use_sak = false; // If SAK is enabled with unmanaged windows, the SAK dialog will never close and will "burn in" the screen + } + + delete tdmconfig; + if (args->isSet( "forcelock" ) || (signalled_forcelock == TRUE)) { trinity_desktop_lock_forced = TRUE; } - LockProcess process(child, (args->isSet( "blank" ) || (signalled_blank == TRUE))); + process.init(child, (args->isSet( "blank" ) || (signalled_blank == TRUE))); if (!child) { process.setChildren(child_sockets); } |