int button)
{
Ecore_Win32_Window *window;
+ RECT rect = { 0, 0, 0, 0 };
INF("mouse button pressed");
window = (Ecore_Win32_Window *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
+ if (!GetWindowRect(window->window, &rect))
+ ERR("GetWindowRect() failed!");
if (button > 3)
{
e->direction = 0;
/* wheel delta is positive or negative, never 0 */
e->z = GET_WHEEL_DELTA_WPARAM(msg->window_param) > 0 ? -1 : 1;
- e->x = GET_X_LPARAM(msg->data_param);
- e->y = GET_Y_LPARAM(msg->data_param);
+ e->x = GET_X_LPARAM(msg->data_param) - rect.left;
+ e->y = GET_Y_LPARAM(msg->data_param) - rect.top;
+ e->root.x = rect.left;
+ e->root.y = rect.top;
e->timestamp = msg->timestamp;
e->modifiers = _ecore_win32_modifiers_get();
e->event_window = e->window;
e->x = GET_X_LPARAM(msg->data_param);
e->y = GET_Y_LPARAM(msg->data_param);
+ e->root.x = rect.left;
+ e->root.y = rect.top;
e->timestamp = msg->timestamp;
e->modifiers = _ecore_win32_modifiers_get();
e->buttons = button;
e->x = GET_X_LPARAM(msg->data_param);
e->y = GET_Y_LPARAM(msg->data_param);
+ e->root.x = rect.left;
+ e->root.y = rect.top;
e->timestamp = msg->timestamp;
e->modifiers = _ecore_win32_modifiers_get();