Ignore spurious duplicated mouse move events.
[GB.QT4] * BUG: Ignore spurious duplicated mouse move events. [GB.QT5] * BUG: Ignore spurious duplicated mouse move events.
This commit is contained in:
parent
dc2d102a95
commit
a08d60a2b1
@ -661,6 +661,8 @@ bool CDRAG_drag_drop(QWidget *w, CWIDGET *control, QDropEvent *e)
|
||||
|
||||
//fprintf(stderr, "CDRAG_drag_drop: %s %s\n", GB.GetClassName(control), control->name);
|
||||
|
||||
e->accept();
|
||||
|
||||
CDRAG_clear(true);
|
||||
CDRAG_info.event = e;
|
||||
CDRAG_destination = control;
|
||||
|
@ -2647,6 +2647,23 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
if (type == QEvent::MouseMove)
|
||||
{
|
||||
// Ignore spurious move events
|
||||
|
||||
static int last_move_x = -1;
|
||||
static int last_move_y = -1;
|
||||
|
||||
if (last_move_x == mevent->globalX() && last_move_y == mevent->globalY())
|
||||
{
|
||||
//fprintf(stderr, "same mouse move! %d %d\n", last_move_x, last_move_y);
|
||||
goto _STANDARD;
|
||||
}
|
||||
|
||||
last_move_x = mevent->globalX();
|
||||
last_move_y = mevent->globalY();
|
||||
}
|
||||
|
||||
if (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick)
|
||||
{
|
||||
GB.GetTime(&timer, TRUE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user