summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2014-06-29 17:57:20 +0200
committerCedric BAIL <c.bail@partner.samsung.com>2014-06-29 19:57:34 +0200
commit08f7baab26b686937130ec6f8851570782160b12 (patch)
treecb84a0629f5e2ce0a7c3b4fc053a78848ffc7a65
parentda06260e793f12230da1cbb8cf9467114974d836 (diff)
downloadefl-08f7baab26b686937130ec6f8851570782160b12.tar.gz
ecore_win32: discard WM_MOUSEMOVE message if it has the same mouse coordinates than the previous one. See link in commit for an explanation
-rw-r--r--src/lib/ecore_win32/ecore_win32.c16
-rw-r--r--src/lib/ecore_win32/ecore_win32_private.h4
-rw-r--r--src/lib/ecore_win32/ecore_win32_window.c2
3 files changed, 19 insertions, 3 deletions
diff --git a/src/lib/ecore_win32/ecore_win32.c b/src/lib/ecore_win32/ecore_win32.c
index c6312a34b9..2c20ae9bdb 100644
--- a/src/lib/ecore_win32/ecore_win32.c
+++ b/src/lib/ecore_win32/ecore_win32.c
@@ -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;
diff --git a/src/lib/ecore_win32/ecore_win32_private.h b/src/lib/ecore_win32/ecore_win32_private.h
index 759ea79b92..af2d86a558 100644
--- a/src/lib/ecore_win32/ecore_win32_private.h
+++ b/src/lib/ecore_win32/ecore_win32_private.h
@@ -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;
diff --git a/src/lib/ecore_win32/ecore_win32_window.c b/src/lib/ecore_win32/ecore_win32_window.c
index 81c6c52c5c..00b7ff21e3 100644
--- a/src/lib/ecore_win32/ecore_win32_window.c
+++ b/src/lib/ecore_win32/ecore_win32_window.c
@@ -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;
}