summaryrefslogtreecommitdiffstats
path: root/kdesktop
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-04-26 14:44:25 -0500
committerTimothy Pearson <[email protected]>2012-04-26 14:44:25 -0500
commite92e82b761f92754db582b5e98c0b3e788eba7d9 (patch)
tree2d433106b37e7de14c90d87a84c45c9b81a9ab96 /kdesktop
parent9187194ce10d7f7297404d0108976960fe463c26 (diff)
downloadtdebase-e92e82b761f92754db582b5e98c0b3e788eba7d9.tar.gz
tdebase-e92e82b761f92754db582b5e98c0b3e788eba7d9.zip
Fix a number of minor flaws in the lock dialog system
If SAK usage is enabled, override TDM theme
Diffstat (limited to 'kdesktop')
-rw-r--r--kdesktop/lock/lockdlg.cc11
-rw-r--r--kdesktop/lock/lockprocess.cc31
-rw-r--r--kdesktop/lock/lockprocess.h4
-rw-r--r--kdesktop/lock/main.cc23
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);
}