summaryrefslogtreecommitdiff
path: root/src/lib/ecore_win32
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 /src/lib/ecore_win32
parentda06260e793f12230da1cbb8cf9467114974d836 (diff)
ecore_win32: discard WM_MOUSEMOVE message if it has the same mouse coordinates than the previous one. See link in commit for an explanation
Diffstat (limited to 'src/lib/ecore_win32')
-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,
144 RECT rect; 144 RECT rect;
145 Ecore_Win32_Window *w = NULL; 145 Ecore_Win32_Window *w = NULL;
146 146
147 INF("moue move message");
148
149 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA); 147 w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
150 148
149 /*
150 * Windows can send several WM_MOUSEMOVE messages, see:
151 * http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx
152 * so we discard those which have the same mouse coordinates
153 */
154 if ((w->drag.current_mouse_x == GET_X_LPARAM(data_param)) &&
155 (w->drag.current_mouse_y == GET_Y_LPARAM(data_param)))
156 return 0;
157
158 w->drag.current_mouse_x = GET_X_LPARAM(data_param);
159 w->drag.current_mouse_y = GET_Y_LPARAM(data_param);
160
161 INF("mouse move message");
162
151 if (w->drag.dragging) 163 if (w->drag.dragging)
152 { 164 {
153 POINT pt; 165 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
114 } shape; 114 } shape;
115 115
116 struct { 116 struct {
117 DWORD type; 117 DWORD type;
118 int x; 118 int x;
119 int y; 119 int y;
120 int w; 120 int w;
121 int h; 121 int h;
122 int px; 122 int px;
123 int py; 123 int py;
124 int current_mouse_x;
125 int current_mouse_y;
124 unsigned int dragging : 1; 126 unsigned int dragging : 1;
125 } drag; 127 } drag;
126 128
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,
143 w->drag.y = y; 143 w->drag.y = y;
144 w->drag.w = rect.right - rect.left; 144 w->drag.w = rect.right - rect.left;
145 w->drag.h = rect.bottom - rect.top; 145 w->drag.h = rect.bottom - rect.top;
146 w->drag.current_mouse_x = -32768;
147 w->drag.current_mouse_y = -32768;
146 148
147 return w; 149 return w;
148} 150}