From d8505c4baf8adf0220c7fb8950255c17368ebcb7 Mon Sep 17 00:00:00 2001 From: antognolli Date: Wed, 23 Nov 2011 16:52:14 +0000 Subject: [PATCH] ecore/fb: Fix tslib input events. With ecore_evas_input, every event must tell for which window it is intended. Patch for SiT. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@65539 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_evas/ecore_evas_fb.c | 1 + src/lib/ecore_fb/ecore_fb_private.h | 2 ++ src/lib/ecore_fb/ecore_fb_ts.c | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/lib/ecore_evas/ecore_evas_fb.c b/src/lib/ecore_evas/ecore_evas_fb.c index 47c13cc..77d9153 100644 --- a/src/lib/ecore_evas/ecore_evas_fb.c +++ b/src/lib/ecore_evas/ecore_evas_fb.c @@ -245,6 +245,7 @@ _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h) { if (ecore_fb_ts_init()) { + ecore_fb_ts_event_window_set(ee); ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_event_mouse_button_down, NULL); ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _ecore_evas_event_mouse_button_up, NULL); ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _ecore_evas_event_mouse_move, NULL); diff --git a/src/lib/ecore_fb/ecore_fb_private.h b/src/lib/ecore_fb/ecore_fb_private.h index e954289..8ff87fa 100644 --- a/src/lib/ecore_fb/ecore_fb_private.h +++ b/src/lib/ecore_fb/ecore_fb_private.h @@ -72,6 +72,8 @@ struct _Ecore_Fb_Input_Device /* ecore_fb_ts.c */ EAPI int ecore_fb_ts_init(void); EAPI void ecore_fb_ts_shutdown(void); +EAPI void ecore_fb_ts_events_window_set(void *window); +EAPI void *ecore_fb_ts_events_window_get(void); /* ecore_fb_vt.c */ int ecore_fb_vt_init(void); diff --git a/src/lib/ecore_fb/ecore_fb_ts.c b/src/lib/ecore_fb/ecore_fb_ts.c index 09c1cc4..395e768 100644 --- a/src/lib/ecore_fb/ecore_fb_ts.c +++ b/src/lib/ecore_fb/ecore_fb_ts.c @@ -74,6 +74,7 @@ struct ts_sample _ecore_fb_tslib_event; #endif static double _ecore_fb_double_click_time = 0.25; +static void *_ecore_fb_ts_event_window = NULL; EAPI int ecore_fb_ts_init(void) @@ -131,6 +132,19 @@ ecore_fb_ts_shutdown(void) if (_ecore_fb_ts_fd >= 0) close(_ecore_fb_ts_fd); _ecore_fb_ts_fd = -1; _ecore_fb_ts_fd_handler_handle = NULL; + _ecore_fb_ts_event_window = NULL; +} + +EAPI void +ecore_fb_ts_event_window_set(void *window) +{ + _ecore_fb_ts_event_window = window; +} + +EAPI void * +ecore_fb_ts_event_window_get(void) +{ + return _ecore_fb_ts_event_window; } /** @@ -259,6 +273,10 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN e->y = y; e->root.x = x; e->root.y = y; + e->window = (Ecore_Window)_ecore_fb_ts_event_window; + e->event_window = e->window; + e->root_window = e->window; + e->same_screen = 1; ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL); } if ((pressure) && (!prev_pressure)) @@ -290,6 +308,10 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN { did_triple = 0; } + e->window = (Ecore_Window)_ecore_fb_ts_event_window; + e->event_window = e->window; + e->root_window = e->window; + e->same_screen = 1; ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL); } else if ((!pressure) && (prev_pressure)) @@ -306,6 +328,10 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN e->double_click = 1; if (did_triple) e->triple_click = 1; + e->window = (Ecore_Window)_ecore_fb_ts_event_window; + e->event_window = e->window; + e->root_window = e->window; + e->same_screen = 1; ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL); } if (did_triple) -- 2.7.4