diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-02-20 14:29:13 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-02-20 14:29:13 -0600 |
commit | 7ca042263042aaa2f10aa0f436bf1df91e476c12 (patch) | |
tree | 4e6a5c14659fa3399596ee4890d429bce3f55b29 /kdesktop/lock/lockprocess.cc | |
parent | 75422c9bc8d704cfde963d7f9061d10d2d78c7ba (diff) | |
download | tdebase-7ca042263042aaa2f10aa0f436bf1df91e476c12.tar.gz tdebase-7ca042263042aaa2f10aa0f436bf1df91e476c12.zip |
Fix potential crash in kdesktop_lock
This is related to Bug 1288
Diffstat (limited to 'kdesktop/lock/lockprocess.cc')
-rw-r--r-- | kdesktop/lock/lockprocess.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index aa68ba1a0..c08c4d424 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -1845,8 +1845,9 @@ bool LockProcess::checkPass() // Wait for SAK press before continuing... SAKDlg inDlg( this ); execDialog( &inDlg ); - if (trinity_desktop_lock_closing_windows) + if (trinity_desktop_lock_closing_windows) { return 0; + } } showVkbd(); @@ -2028,7 +2029,9 @@ void LockProcess::cleanupPopup() { TQWidget *dlg = (TQWidget *)sender(); mDialogs.remove( dlg ); - fakeFocusIn( mDialogs.first()->winId() ); + if ( mDialogs.isEmpty() ) { + fakeFocusIn( mDialogs.first()->winId() ); + } } void LockProcess::doFunctionKeyBroadcast() { @@ -2547,7 +2550,7 @@ void LockProcess::slotMouseActivity(XEvent *event) bool inDialog = 0; XButtonEvent *be = (XButtonEvent *) event; XMotionEvent *me = (XMotionEvent *) event; - if ((event->type == ButtonPress) && (mDialogs.first())) { + if ((event->type == ButtonPress) && (!mDialogs.isEmpty())) { // Get geometry including window frame/titlebar TQRect fgeom = mDialogs.first()->frameGeometry(); TQRect wgeom = mDialogs.first()->geometry(); @@ -2588,7 +2591,7 @@ void LockProcess::slotMouseActivity(XEvent *event) int deltaY = me->y_root - m_mousePrevY; m_dialogPrevX = m_dialogPrevX + deltaX; m_dialogPrevY = m_dialogPrevY + deltaY; - if (mDialogs.first()) mDialogs.first()->move(m_dialogPrevX, m_dialogPrevY); + if (!mDialogs.isEmpty()) mDialogs.first()->move(m_dialogPrevX, m_dialogPrevY); m_mousePrevX = me->x_root; m_mousePrevY = me->y_root; |