mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 22:14:35 +00:00
Simple fix for bug 4464
http://www.lyx.org/trac/ticket/4464 Thanks to Vincent for showing the way. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29394 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
26b1c55e03
commit
3a502dfbec
@ -231,7 +231,7 @@ private:
|
|||||||
// cursor is at the top or bottom edge of the viewport. One scroll per 0.2 s
|
// cursor is at the top or bottom edge of the viewport. One scroll per 0.2 s
|
||||||
SyntheticMouseEvent::SyntheticMouseEvent()
|
SyntheticMouseEvent::SyntheticMouseEvent()
|
||||||
: timeout(200), restart_timeout(true),
|
: timeout(200), restart_timeout(true),
|
||||||
x_old(-1), y_old(-1), scrollbar_value_old(-1.0)
|
x_old(-1), y_old(-1), min_scrollbar_old(-1.0), max_scrollbar_old(-1.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -787,10 +787,10 @@ void GuiWorkArea::mouseMoveEvent(QMouseEvent * e)
|
|||||||
|
|
||||||
// Has anything changed on-screen since the last QMouseEvent
|
// Has anything changed on-screen since the last QMouseEvent
|
||||||
// was received?
|
// was received?
|
||||||
double const scrollbar_value = verticalScrollBar()->value();
|
|
||||||
if (e->x() == synthetic_mouse_event_.x_old
|
if (e->x() == synthetic_mouse_event_.x_old
|
||||||
&& e->y() == synthetic_mouse_event_.y_old
|
&& e->y() == synthetic_mouse_event_.y_old
|
||||||
&& scrollbar_value == synthetic_mouse_event_.scrollbar_value_old) {
|
&& synthetic_mouse_event_.min_scrollbar_old == verticalScrollBar()->minimum()
|
||||||
|
&& synthetic_mouse_event_.max_scrollbar_old == verticalScrollBar()->maximum()) {
|
||||||
// Nothing changed on-screen since the last QMouseEvent.
|
// Nothing changed on-screen since the last QMouseEvent.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -798,7 +798,8 @@ void GuiWorkArea::mouseMoveEvent(QMouseEvent * e)
|
|||||||
// Yes something has changed. Store the params used to check this.
|
// Yes something has changed. Store the params used to check this.
|
||||||
synthetic_mouse_event_.x_old = e->x();
|
synthetic_mouse_event_.x_old = e->x();
|
||||||
synthetic_mouse_event_.y_old = e->y();
|
synthetic_mouse_event_.y_old = e->y();
|
||||||
synthetic_mouse_event_.scrollbar_value_old = scrollbar_value;
|
synthetic_mouse_event_.min_scrollbar_old = verticalScrollBar()->minimum();
|
||||||
|
synthetic_mouse_event_.max_scrollbar_old = verticalScrollBar()->maximum();
|
||||||
|
|
||||||
// ... and dispatch the event to the LyX core.
|
// ... and dispatch the event to the LyX core.
|
||||||
dispatch(cmd);
|
dispatch(cmd);
|
||||||
@ -846,14 +847,17 @@ void GuiWorkArea::generateSyntheticMouseEvent()
|
|||||||
|
|
||||||
// Has anything changed on-screen since the last timeout signal
|
// Has anything changed on-screen since the last timeout signal
|
||||||
// was received?
|
// was received?
|
||||||
double const scrollbar_value = verticalScrollBar()->value();
|
int const min_scrollbar = verticalScrollBar()->minimum();
|
||||||
if (scrollbar_value != synthetic_mouse_event_.scrollbar_value_old) {
|
int const max_scrollbar = verticalScrollBar()->maximum();
|
||||||
// Yes it has. Store the params used to check this.
|
if (min_scrollbar == synthetic_mouse_event_.min_scrollbar_old
|
||||||
synthetic_mouse_event_.scrollbar_value_old = scrollbar_value;
|
&& max_scrollbar == synthetic_mouse_event_.max_scrollbar_old) {
|
||||||
|
return;
|
||||||
// ... and dispatch the event to the LyX core.
|
|
||||||
dispatch(synthetic_mouse_event_.cmd);
|
|
||||||
}
|
}
|
||||||
|
// Yes it has. Store the params used to check this.
|
||||||
|
synthetic_mouse_event_.min_scrollbar_old = min_scrollbar;
|
||||||
|
synthetic_mouse_event_.max_scrollbar_old = max_scrollbar;
|
||||||
|
// ... and dispatch the event to the LyX core.
|
||||||
|
dispatch(synthetic_mouse_event_.cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,7 +87,8 @@ public:
|
|||||||
bool restart_timeout;
|
bool restart_timeout;
|
||||||
int x_old;
|
int x_old;
|
||||||
int y_old;
|
int y_old;
|
||||||
double scrollbar_value_old;
|
int min_scrollbar_old;
|
||||||
|
int max_scrollbar_old;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user