Fix kdesktop_lock crash on mouse events when no dialog is displayed

This closes Bug 1008
(cherry picked from commit 09dbd438c1)
v3.5.13-sru
Timothy Pearson 13 years ago committed by Slávek Banko
parent a13e78ad71
commit 1dcd235e7e

@ -2391,7 +2391,7 @@ void LockProcess::slotMouseActivity(XEvent *event)
bool inDialog = 0; bool inDialog = 0;
XButtonEvent *be = (XButtonEvent *) event; XButtonEvent *be = (XButtonEvent *) event;
XMotionEvent *me = (XMotionEvent *) event; XMotionEvent *me = (XMotionEvent *) event;
if (event->type == ButtonPress) { if ((event->type == ButtonPress) && (mDialogs.first())) {
// Get geometry including window frame/titlebar // Get geometry including window frame/titlebar
TQRect fgeom = mDialogs.first()->frameGeometry(); TQRect fgeom = mDialogs.first()->frameGeometry();
TQRect wgeom = mDialogs.first()->geometry(); TQRect wgeom = mDialogs.first()->geometry();
@ -2432,7 +2432,7 @@ void LockProcess::slotMouseActivity(XEvent *event)
int deltaY = me->y_root - m_mousePrevY; int deltaY = me->y_root - m_mousePrevY;
m_dialogPrevX = m_dialogPrevX + deltaX; m_dialogPrevX = m_dialogPrevX + deltaX;
m_dialogPrevY = m_dialogPrevY + deltaY; m_dialogPrevY = m_dialogPrevY + deltaY;
mDialogs.first()->move(m_dialogPrevX, m_dialogPrevY); if (mDialogs.first()) mDialogs.first()->move(m_dialogPrevX, m_dialogPrevY);
m_mousePrevX = me->x_root; m_mousePrevX = me->x_root;
m_mousePrevY = me->y_root; m_mousePrevY = me->y_root;

Loading…
Cancel
Save