ecore_evas: Try to fix mouse events on Windows

See also de5f293426 and T3789

I wrongly assumed that multi.{x,y} would be properly set.
I'm assuming here that multi.{x,y} == (0,0) means they are
not set, and that double comparison to 0 works fine.
This commit is contained in:
Jean-Philippe Andre 2016-06-20 16:26:52 +09:00
parent 0ffa16d9cf
commit a087ca84b0
1 changed files with 12 additions and 5 deletions

View File

@ -4304,10 +4304,17 @@ ecore_evas_psl1ght_new(const char* name, int w, int h)
} while (0)
static inline void
_pointer_position_set(Efl_Event_Pointer_Data *ev, Ecore_Evas *ee, double mx, double my)
_pointer_position_set(Efl_Event_Pointer_Data *ev, Ecore_Evas *ee, int x, int y,
double mx, double my)
{
int fx, fy, fw, fh;
if (!mx && !my)
{
mx = x;
my = y;
}
evas_output_framespace_get(ee->evas, &fx, &fy, &fw, &fh);
if (ee->rotation == 0)
EVENT_XY_SET(ev, mx, my, fx, fy);
@ -4368,7 +4375,7 @@ _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_P
if (info->triple_click) ev->button_flags |= EFL_POINTER_FLAGS_TRIPLE_CLICK;
ev->timestamp = info->timestamp;
ev->finger = info->multi.device;
_pointer_position_set(ev, ee, info->multi.x, info->multi.y);
_pointer_position_set(ev, ee, info->x, info->y, info->multi.x, info->multi.y);
ev->radius = info->multi.radius;
ev->radius_x = info->multi.radius_x;
ev->radius_y = info->multi.radius_y;
@ -4425,7 +4432,7 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info)
ev->action = EFL_POINTER_ACTION_MOVE;
ev->timestamp = info->timestamp;
ev->finger = info->multi.device;
_pointer_position_set(ev, ee, info->multi.x, info->multi.y);
_pointer_position_set(ev, ee, info->x, info->y, info->multi.x, info->multi.y);
ev->radius = info->multi.radius;
ev->radius_x = info->multi.radius_x;
@ -4461,7 +4468,7 @@ _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info)
ev->action = EFL_POINTER_ACTION_WHEEL;
ev->timestamp = info->timestamp;
_pointer_position_set(ev, ee, info->x, info->y);
_pointer_position_set(ev, ee, info->x, info->y, info->x, info->y);
ev->wheel.z = info->z;
ev->wheel.dir = info->direction ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL;
@ -4490,7 +4497,7 @@ _direct_mouse_inout(Ecore_Evas *ee, const Ecore_Event_Mouse_IO *info, Efl_Pointe
ev->action = action;
ev->timestamp = info->timestamp;
_pointer_position_set(ev, ee, info->x, info->y);
_pointer_position_set(ev, ee, info->x, info->y, info->x, info->y);
eo_event_callback_call(e, _event_description_get(ev->action), evt);
processed = ev->evas_done;