From 4e64708443bc3132614e7287c2d6558894c44c9f Mon Sep 17 00:00:00 2001 From: caro Date: Wed, 24 Nov 2010 17:04:03 +0000 Subject: [PATCH] fix mouse event on Win XP, should be fixed on Win CE git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@54938 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_win32/ecore_win32_event.c | 12 +++++++++++- src/lib/ecore_wince/ecore_wince_event.c | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_win32/ecore_win32_event.c b/src/lib/ecore_win32/ecore_win32_event.c index c133ead..b6e2472 100644 --- a/src/lib/ecore_win32/ecore_win32_event.c +++ b/src/lib/ecore_win32/ecore_win32_event.c @@ -56,7 +56,7 @@ _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg, INF("key pressed"); - e = (Ecore_Event_Key *)malloc(sizeof(Ecore_Event_Key)); + e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key)); if (!e) return; if (is_keystroke) @@ -91,6 +91,7 @@ _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg, free(e); return; } + e->event_window = e->window; e->timestamp = msg->time; _ecore_win32_event_last_time = e->timestamp; @@ -141,6 +142,7 @@ _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg, free(e); return; } + e->event_window = e->window; e->timestamp = msg->time; _ecore_win32_event_last_time = e->timestamp; @@ -166,6 +168,7 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->direction = 0; /* wheel delta is positive or negative, never 0 */ e->z = GET_WHEEL_DELTA_WPARAM(msg->window_param) > 0 ? -1 : 1; @@ -187,6 +190,7 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->x = GET_X_LPARAM(msg->data_param); e->y = GET_Y_LPARAM(msg->data_param); e->timestamp = msg->time; @@ -212,6 +216,7 @@ _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->buttons = button; e->x = GET_X_LPARAM(msg->data_param); e->y = GET_Y_LPARAM(msg->data_param); @@ -267,6 +272,7 @@ _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->x = GET_X_LPARAM(msg->data_param); e->y = GET_Y_LPARAM(msg->data_param); e->timestamp = msg->time; @@ -284,6 +290,7 @@ _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->buttons = button; e->x = GET_X_LPARAM(msg->data_param); e->y = GET_Y_LPARAM(msg->data_param); @@ -320,6 +327,7 @@ _ecore_win32_event_handle_motion_notify(Ecore_Win32_Callback_Data *msg) if (!e) return; e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA); + e->event_window = e->window; e->x = GET_X_LPARAM(msg->data_param); e->y = GET_Y_LPARAM(msg->data_param); e->timestamp = msg->time; @@ -339,6 +347,7 @@ _ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg) if (!e) return; e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA); + e->event_window = e->window; e->x = msg->x; e->y = msg->y; e->timestamp = msg->time; @@ -378,6 +387,7 @@ _ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg) if (!e) return; e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA); + e->event_window = e->window; e->x = msg->x; e->y = msg->y; e->timestamp = msg->time; diff --git a/src/lib/ecore_wince/ecore_wince_event.c b/src/lib/ecore_wince/ecore_wince_event.c index e2599d9..5193fa0 100644 --- a/src/lib/ecore_wince/ecore_wince_event.c +++ b/src/lib/ecore_wince/ecore_wince_event.c @@ -406,6 +406,7 @@ _ecore_wince_event_handle_key_press(Ecore_WinCE_Callback_Data *msg, } e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA); + e->event_window = e->window; if (!e->window) { free(e); @@ -453,6 +454,7 @@ _ecore_wince_event_handle_key_release(Ecore_WinCE_Callback_Data *msg, } e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA); + e->event_window = e->window; if (!e->window) { free(e); @@ -482,6 +484,7 @@ _ecore_wince_event_handle_button_press(Ecore_WinCE_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->x = LOWORD(msg->data_param); e->y = HIWORD(msg->data_param); e->timestamp = msg->time; @@ -507,6 +510,7 @@ _ecore_wince_event_handle_button_press(Ecore_WinCE_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->buttons = button; e->x = LOWORD(msg->data_param); e->y = HIWORD(msg->data_param); @@ -561,6 +565,7 @@ _ecore_wince_event_handle_button_release(Ecore_WinCE_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->x = LOWORD(msg->data_param); e->y = HIWORD(msg->data_param); e->timestamp = msg->time; @@ -578,6 +583,7 @@ _ecore_wince_event_handle_button_release(Ecore_WinCE_Callback_Data *msg, if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->buttons = button; e->x = LOWORD(msg->data_param); e->y = HIWORD(msg->data_param); @@ -614,6 +620,7 @@ _ecore_wince_event_handle_motion_notify(Ecore_WinCE_Callback_Data *msg) if (!e) return; e->window = (Ecore_Window)GetWindowLong(msg->window, GWL_USERDATA); + e->event_window = e->window; e->x = LOWORD(msg->data_param); e->y = HIWORD(msg->data_param); e->timestamp = msg->time; @@ -637,6 +644,7 @@ _ecore_wince_event_handle_enter_notify(Ecore_WinCE_Callback_Data *msg) if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->x = msg->x; e->y = msg->y; e->timestamp = msg->time; @@ -680,6 +688,7 @@ _ecore_wince_event_handle_leave_notify(Ecore_WinCE_Callback_Data *msg) if (!e) return; e->window = (Ecore_Window)window; + e->event_window = e->window; e->x = msg->x; e->y = msg->y; e->timestamp = msg->time; -- 2.7.4