summaryrefslogtreecommitdiff
path: root/src/lib/ecore_input_evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-07-07 14:15:29 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-07-07 14:20:53 -0400
commitfbb462371fbb922e4387e77efb27690f8e44d8a1 (patch)
tree104dcbc68182dfa66fb514d6a0f7dce143dfae78 /src/lib/ecore_input_evas
parente9688e63a5ac0b08766b9c861ddb2ddd91944e98 (diff)
ecore-input-evas: fix canvas mouse event dispatch
this was broken in 5cb6cdbc5e1a13ea0262e155983b494e6519abde such that when multiple sources produce mouse events using the same device, these events are marshalled as though they were from the same canvas. the result is that eventing is wrong on at least one of the canvases, and spurious mouse-up events are triggered before every mouse down fix T2509
Diffstat (limited to 'src/lib/ecore_input_evas')
-rw-r--r--src/lib/ecore_input_evas/ecore_input_evas.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c
index 4c95bf9213..d332b4c2e0 100644
--- a/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -48,6 +48,7 @@ struct _Ecore_Input_Last
48 unsigned int device; 48 unsigned int device;
49 unsigned int buttons; 49 unsigned int buttons;
50 Ecore_Input_State state; 50 Ecore_Input_State state;
51 Ecore_Window win;
51 52
52 Eina_Bool faked : 1; 53 Eina_Bool faked : 1;
53}; 54};
@@ -118,7 +119,7 @@ _ecore_event_last_check(Ecore_Event_Last *eel, Ecore_Event_Press press)
118} 119}
119 120
120static Ecore_Event_Last * 121static Ecore_Event_Last *
121_ecore_event_evas_lookup(unsigned int device, unsigned int buttons, Eina_Bool create_new) 122_ecore_event_evas_lookup(unsigned int device, unsigned int buttons, Ecore_Window win, Eina_Bool create_new)
122{ 123{
123 Ecore_Event_Last *eel; 124 Ecore_Event_Last *eel;
124 Eina_List *l; 125 Eina_List *l;
@@ -137,6 +138,7 @@ _ecore_event_evas_lookup(unsigned int device, unsigned int buttons, Eina_Bool cr
137 eel->buttons = buttons; 138 eel->buttons = buttons;
138 eel->state = ECORE_INPUT_NONE; 139 eel->state = ECORE_INPUT_NONE;
139 eel->faked = EINA_FALSE; 140 eel->faked = EINA_FALSE;
141 eel->win = win;
140 142
141 _last_events = eina_list_append(_last_events, eel); 143 _last_events = eina_list_append(_last_events, eel);
142 return eel; 144 return eel;
@@ -174,14 +176,15 @@ static Eina_Bool
174_ecore_event_evas_push_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press press) 176_ecore_event_evas_push_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press press)
175{ 177{
176 Ecore_Event_Last *eel; 178 Ecore_Event_Last *eel;
177 Ecore_Input_Action action; 179 Ecore_Input_Action action = ECORE_INPUT_CONTINUE;
178 180
179 //_ecore_event_evas_mouse_button already check press or cancel without history 181 //_ecore_event_evas_mouse_button already check press or cancel without history
180 eel = _ecore_event_evas_lookup(e->multi.device, e->buttons, EINA_TRUE); 182 eel = _ecore_event_evas_lookup(e->multi.device, e->buttons, e->window, EINA_TRUE);
181 if (!eel) return EINA_FALSE; 183 if (!eel) return EINA_FALSE;
182 INF("dev(%d), button(%d), last_press(%d), press(%d)", e->multi.device, e->buttons, eel->state, press); 184 INF("dev(%d), button(%d), last_press(%d), press(%d)", e->multi.device, e->buttons, eel->state, press);
183 185
184 action = _ecore_event_last_check(eel, press); 186 if (e->window == eel->win)
187 action = _ecore_event_last_check(eel, press);
185 INF("action(%d)", action); 188 INF("action(%d)", action);
186 switch (action) 189 switch (action)
187 { 190 {
@@ -191,6 +194,7 @@ _ecore_event_evas_push_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Pre
191 break; 194 break;
192 case ECORE_INPUT_IGNORE: 195 case ECORE_INPUT_IGNORE:
193 default: 196 default:
197 eel->win = e->window;
194 return EINA_FALSE; 198 return EINA_FALSE;
195 } 199 }
196 200
@@ -205,6 +209,7 @@ _ecore_event_evas_push_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Pre
205 default: 209 default:
206 break; 210 break;
207 } 211 }
212 eel->win = e->window;
208 213
209 //if up event not occurs from under layers of ecore 214 //if up event not occurs from under layers of ecore
210 //up event is generated by ecore 215 //up event is generated by ecore
@@ -456,15 +461,16 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
456 if (press != ECORE_DOWN) 461 if (press != ECORE_DOWN)
457 { 462 {
458 //ECORE_UP or ECORE_CANCEL 463 //ECORE_UP or ECORE_CANCEL
459 eel = _ecore_event_evas_lookup(e->multi.device, e->buttons, EINA_FALSE); 464 eel = _ecore_event_evas_lookup(e->multi.device, e->buttons, e->window, EINA_FALSE);
460 if (!eel) 465 if (!eel)
461 { 466 {
462 WRN("ButtonEvent has no history."); 467 WRN("ButtonEvent has no history.");
463 return ECORE_CALLBACK_PASS_ON; 468 return ECORE_CALLBACK_PASS_ON;
464 } 469 }
465 470
466 if ((eel->state == ECORE_INPUT_UP) || 471 if ((e->window == eel->win) &&
467 (eel->state == ECORE_INPUT_CANCEL)) 472 ((eel->state == ECORE_INPUT_UP) ||
473 (eel->state == ECORE_INPUT_CANCEL)))
468 { 474 {
469 WRN("ButtonEvent has wrong history. Last state=%d", eel->state); 475 WRN("ButtonEvent has wrong history. Last state=%d", eel->state);
470 return ECORE_CALLBACK_PASS_ON; 476 return ECORE_CALLBACK_PASS_ON;