forked from enlightenment/efl
ecore_win32: discard WM_MOUSEMOVE message if it has the same mouse coordinates than the previous one. See link in commit for an explanation
This commit is contained in:
parent
da06260e79
commit
08f7baab26
|
@ -144,10 +144,22 @@ _ecore_win32_window_procedure(HWND window,
|
|||
RECT rect;
|
||||
Ecore_Win32_Window *w = NULL;
|
||||
|
||||
INF("moue move message");
|
||||
|
||||
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
|
||||
|
||||
/*
|
||||
* Windows can send several WM_MOUSEMOVE messages, see:
|
||||
* http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx
|
||||
* so we discard those which have the same mouse coordinates
|
||||
*/
|
||||
if ((w->drag.current_mouse_x == GET_X_LPARAM(data_param)) &&
|
||||
(w->drag.current_mouse_y == GET_Y_LPARAM(data_param)))
|
||||
return 0;
|
||||
|
||||
w->drag.current_mouse_x = GET_X_LPARAM(data_param);
|
||||
w->drag.current_mouse_y = GET_Y_LPARAM(data_param);
|
||||
|
||||
INF("mouse move message");
|
||||
|
||||
if (w->drag.dragging)
|
||||
{
|
||||
POINT pt;
|
||||
|
|
|
@ -114,13 +114,15 @@ struct _Ecore_Win32_Window
|
|||
} shape;
|
||||
|
||||
struct {
|
||||
DWORD type;
|
||||
DWORD type;
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
int px;
|
||||
int py;
|
||||
int current_mouse_x;
|
||||
int current_mouse_y;
|
||||
unsigned int dragging : 1;
|
||||
} drag;
|
||||
|
||||
|
|
|
@ -143,6 +143,8 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
|
|||
w->drag.y = y;
|
||||
w->drag.w = rect.right - rect.left;
|
||||
w->drag.h = rect.bottom - rect.top;
|
||||
w->drag.current_mouse_x = -32768;
|
||||
w->drag.current_mouse_y = -32768;
|
||||
|
||||
return w;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue