forked from enlightenment/efl
ecore_evas: Fix mouse inputs
Yup, I broke everything again. This time, mouse move inputs would not move the cursor, since I was bypassing the regular _ecore_evas_mouse_xxx callbacks. Fixes T3766
This commit is contained in:
parent
0505a729e2
commit
29d5be9e5e
|
@ -3359,8 +3359,8 @@ _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
|
||||||
ecore_timer_add(IDLE_FLUSH_TIME, _ecore_evas_cb_idle_flush, ee);
|
ecore_timer_add(IDLE_FLUSH_TIME, _ecore_evas_cb_idle_flush, ee);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
static void
|
||||||
_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
|
_ecore_evas_mouse_move_process_internal(Ecore_Evas *ee, int x, int y, unsigned int timestamp, Eina_Bool feed)
|
||||||
{
|
{
|
||||||
int fx, fy, fw, fh;
|
int fx, fy, fw, fh;
|
||||||
ee->mouse.x = x;
|
ee->mouse.x = x;
|
||||||
|
@ -3388,6 +3388,7 @@ _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timest
|
||||||
y - fx - ee->prop.cursor.hot.x,
|
y - fx - ee->prop.cursor.hot.x,
|
||||||
ee->w + fh - x - fy - 1 - ee->prop.cursor.hot.y);
|
ee->w + fh - x - fy - 1 - ee->prop.cursor.hot.y);
|
||||||
}
|
}
|
||||||
|
if (!feed) return;
|
||||||
if (ee->rotation == 0)
|
if (ee->rotation == 0)
|
||||||
evas_event_input_mouse_move(ee->evas, x, y, timestamp, NULL);
|
evas_event_input_mouse_move(ee->evas, x, y, timestamp, NULL);
|
||||||
else if (ee->rotation == 90)
|
else if (ee->rotation == 90)
|
||||||
|
@ -3398,6 +3399,12 @@ _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timest
|
||||||
evas_event_input_mouse_move(ee->evas, y, ee->w + fh - x - 1, timestamp, NULL);
|
evas_event_input_mouse_move(ee->evas, y, ee->w + fh - x - 1, timestamp, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
|
||||||
|
{
|
||||||
|
_ecore_evas_mouse_move_process_internal(ee, x, y, timestamp, EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
_ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
|
_ecore_evas_mouse_multi_move_process(Ecore_Evas *ee, int device,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
|
@ -4400,6 +4407,8 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info)
|
||||||
Evas *e = ee->evas;
|
Evas *e = ee->evas;
|
||||||
Eina_Bool processed;
|
Eina_Bool processed;
|
||||||
|
|
||||||
|
_ecore_evas_mouse_move_process_internal(ee, info->x, info->y, info->timestamp, EINA_FALSE);
|
||||||
|
|
||||||
/* Unused information:
|
/* Unused information:
|
||||||
* same_screen
|
* same_screen
|
||||||
* root.{x,y}
|
* root.{x,y}
|
||||||
|
|
|
@ -599,34 +599,39 @@ ecore_event_evas_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *
|
||||||
e = event;
|
e = event;
|
||||||
lookup = _ecore_event_window_match(e->event_window);
|
lookup = _ecore_event_window_match(e->event_window);
|
||||||
if (!lookup) return ECORE_CALLBACK_PASS_ON;
|
if (!lookup) return ECORE_CALLBACK_PASS_ON;
|
||||||
if (lookup->direct &&
|
|
||||||
lookup->direct(lookup->window, ECORE_EVENT_MOUSE_MOVE, e))
|
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
|
||||||
if (e->multi.device == 0)
|
if (e->multi.device == 0)
|
||||||
{
|
{
|
||||||
_ecore_event_evas_push_mouse_move(e);
|
_ecore_event_evas_push_mouse_move(e);
|
||||||
ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
|
ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
|
||||||
if (lookup->move_mouse)
|
if (!lookup->direct ||
|
||||||
lookup->move_mouse(lookup->window, e->x, e->y, e->timestamp);
|
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_MOVE, e))
|
||||||
else
|
{
|
||||||
evas_event_input_mouse_move(lookup->evas, e->x, e->y, e->timestamp,
|
if (lookup->move_mouse)
|
||||||
NULL);
|
lookup->move_mouse(lookup->window, e->x, e->y, e->timestamp);
|
||||||
|
else
|
||||||
|
evas_event_input_mouse_move(lookup->evas, e->x, e->y, e->timestamp,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (lookup->move_multi)
|
if (!lookup->direct ||
|
||||||
lookup->move_multi(lookup->window, e->multi.device,
|
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_MOVE, e))
|
||||||
e->x, e->y, e->multi.radius,
|
{
|
||||||
e->multi.radius_x, e->multi.radius_y,
|
if (lookup->move_multi)
|
||||||
e->multi.pressure, e->multi.angle,
|
lookup->move_multi(lookup->window, e->multi.device,
|
||||||
e->multi.x, e->multi.y, e->timestamp);
|
e->x, e->y, e->multi.radius,
|
||||||
else
|
e->multi.radius_x, e->multi.radius_y,
|
||||||
evas_event_input_multi_move(lookup->evas, e->multi.device,
|
e->multi.pressure, e->multi.angle,
|
||||||
e->x, e->y, e->multi.radius,
|
e->multi.x, e->multi.y, e->timestamp);
|
||||||
e->multi.radius_x, e->multi.radius_y,
|
else
|
||||||
e->multi.pressure, e->multi.angle,
|
evas_event_input_multi_move(lookup->evas, e->multi.device,
|
||||||
e->multi.x, e->multi.y, e->timestamp,
|
e->x, e->y, e->multi.radius,
|
||||||
NULL);
|
e->multi.radius_x, e->multi.radius_y,
|
||||||
|
e->multi.pressure, e->multi.angle,
|
||||||
|
e->multi.x, e->multi.y, e->timestamp,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue