From 6a082a6d89641a5c0d32824208a1089378f566be Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 7 Feb 2008 13:40:31 +0000 Subject: [PATCH] Cosmetics. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22833 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.cpp | 34 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index a6275c816e..1c66633e62 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -603,7 +603,7 @@ void GuiWorkArea::mouseMoveEvent(QMouseEvent * e) // we kill the triple click if we move doubleClickTimeout(); FuncRequest cmd(LFUN_MOUSE_MOTION, e->x(), e->y(), - q_motion_state(e->buttons())); + q_motion_state(e->buttons())); // If we're above or below the work area... if (e->y() <= 20 || e->y() >= viewport()->height() - 20) { @@ -626,11 +626,10 @@ void GuiWorkArea::mouseMoveEvent(QMouseEvent * e) // occurred after the one used to start the timeout // in the first place. return; - else { - synthetic_mouse_event_.restart_timeout = true; - synthetic_mouse_event_.timeout.start(); - // Fall through to handle this event... - } + + synthetic_mouse_event_.restart_timeout = true; + synthetic_mouse_event_.timeout.start(); + // Fall through to handle this event... } else if (synthetic_mouse_event_.timeout.running()) { // Store the event, to be possibly handled when the timeout @@ -647,17 +646,20 @@ void GuiWorkArea::mouseMoveEvent(QMouseEvent * e) // Has anything changed on-screen since the last QMouseEvent // was received? double const scrollbar_value = verticalScrollBar()->value(); - if (e->x() != synthetic_mouse_event_.x_old || - e->y() != synthetic_mouse_event_.y_old || - scrollbar_value != synthetic_mouse_event_.scrollbar_value_old) { - // Yes it has. Store the params used to check this. - synthetic_mouse_event_.x_old = e->x(); - synthetic_mouse_event_.y_old = e->y(); - synthetic_mouse_event_.scrollbar_value_old = scrollbar_value; - - // ... and dispatch the event to the LyX core. - dispatch(cmd); + if (e->x() == synthetic_mouse_event_.x_old + && e->y() == synthetic_mouse_event_.y_old + && scrollbar_value == synthetic_mouse_event_.scrollbar_value_old) { + // Nothing changed on-screen since the last QMouseEvent. + return; } + + // Yes something has changed. Store the params used to check this. + synthetic_mouse_event_.x_old = e->x(); + synthetic_mouse_event_.y_old = e->y(); + synthetic_mouse_event_.scrollbar_value_old = scrollbar_value; + + // ... and dispatch the event to the LyX core. + dispatch(cmd); } -- 2.39.2