summaryrefslogtreecommitdiff
path: root/src/lib/ecore_win32
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-08-25 15:31:05 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-08-25 15:34:13 +0900
commit1f1542f82404fa2262526cc3eed7b2edc622c5ce (patch)
tree24831736015157edff1a418280a8136e440629f6 /src/lib/ecore_win32
parent08238de3e0fdc372cdfa5908be8239c492c209b1 (diff)
ecore_win: fix the incorrect mouse cursor position.
Ecore_Event_Mouse_* x, y values are relative to the current window position as well as the root x, y, values are relative to the root window. previously, x,y is started from the root window and root x, y values are invalid. fix them @fix
Diffstat (limited to 'src/lib/ecore_win32')
-rw-r--r--src/lib/ecore_win32/ecore_win32_event.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/ecore_win32/ecore_win32_event.c b/src/lib/ecore_win32/ecore_win32_event.c
index f9d29a1a6f..3b5100dced 100644
--- a/src/lib/ecore_win32/ecore_win32_event.c
+++ b/src/lib/ecore_win32/ecore_win32_event.c
@@ -1421,10 +1421,13 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
1421 int button) 1421 int button)
1422{ 1422{
1423 Ecore_Win32_Window *window; 1423 Ecore_Win32_Window *window;
1424 RECT rect = { 0, 0, 0, 0 };
1424 1425
1425 INF("mouse button pressed"); 1426 INF("mouse button pressed");
1426 1427
1427 window = (Ecore_Win32_Window *)GetWindowLongPtr(msg->window, GWLP_USERDATA); 1428 window = (Ecore_Win32_Window *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
1429 if (!GetWindowRect(window->window, &rect))
1430 ERR("GetWindowRect() failed!");
1428 1431
1429 if (button > 3) 1432 if (button > 3)
1430 { 1433 {
@@ -1438,8 +1441,10 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
1438 e->direction = 0; 1441 e->direction = 0;
1439 /* wheel delta is positive or negative, never 0 */ 1442 /* wheel delta is positive or negative, never 0 */
1440 e->z = GET_WHEEL_DELTA_WPARAM(msg->window_param) > 0 ? -1 : 1; 1443 e->z = GET_WHEEL_DELTA_WPARAM(msg->window_param) > 0 ? -1 : 1;
1441 e->x = GET_X_LPARAM(msg->data_param); 1444 e->x = GET_X_LPARAM(msg->data_param) - rect.left;
1442 e->y = GET_Y_LPARAM(msg->data_param); 1445 e->y = GET_Y_LPARAM(msg->data_param) - rect.top;
1446 e->root.x = rect.left;
1447 e->root.y = rect.top;
1443 e->timestamp = msg->timestamp; 1448 e->timestamp = msg->timestamp;
1444 e->modifiers = _ecore_win32_modifiers_get(); 1449 e->modifiers = _ecore_win32_modifiers_get();
1445 1450
@@ -1458,8 +1463,10 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
1458 1463
1459 e->window = (Ecore_Window)window; 1464 e->window = (Ecore_Window)window;
1460 e->event_window = e->window; 1465 e->event_window = e->window;
1461 e->x = GET_X_LPARAM(msg->data_param); 1466 e->x = GET_X_LPARAM(msg->data_param) - rect.left;
1462 e->y = GET_Y_LPARAM(msg->data_param); 1467 e->y = GET_Y_LPARAM(msg->data_param) - rect.top;
1468 e->root.x = rect.left;
1469 e->root.y = rect.top;
1463 e->timestamp = msg->timestamp; 1470 e->timestamp = msg->timestamp;
1464 e->modifiers = _ecore_win32_modifiers_get(); 1471 e->modifiers = _ecore_win32_modifiers_get();
1465 1472
@@ -1486,8 +1493,10 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
1486 e->window = (Ecore_Window)window; 1493 e->window = (Ecore_Window)window;
1487 e->event_window = e->window; 1494 e->event_window = e->window;
1488 e->buttons = button; 1495 e->buttons = button;
1489 e->x = GET_X_LPARAM(msg->data_param); 1496 e->x = GET_X_LPARAM(msg->data_param) - rect.left;
1490 e->y = GET_Y_LPARAM(msg->data_param); 1497 e->y = GET_Y_LPARAM(msg->data_param) - rect.top;
1498 e->root.x = rect.left;
1499 e->root.y = rect.top;
1491 e->timestamp = msg->timestamp; 1500 e->timestamp = msg->timestamp;
1492 e->modifiers = _ecore_win32_modifiers_get(); 1501 e->modifiers = _ecore_win32_modifiers_get();
1493 1502