ecore_evas/wayland: Consider the frame/border for pointer position.

When the window is rotated, the logical pointer position is calculated
based on the window size (width or height) minus the current position,
depending on the rotation used. For wayland, we must add the window
decorations to the ecore_evas size, when doing this calculation.
This commit is contained in:
Rafael Antognolli 2013-04-24 17:56:53 -03:00
parent f18174f302
commit 72bbf5b49b
1 changed files with 11 additions and 9 deletions

View File

@ -2564,12 +2564,14 @@ _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
EAPI void
_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
{
int fx, fy, fw, fh;
ee->mouse.x = x;
ee->mouse.y = y;
evas_output_framespace_get(ee->evas, &fx, &fy, &fw, &fh);
if (ee->prop.cursor.object)
{
int fx, fy;
evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
evas_object_show(ee->prop.cursor.object);
if (ee->rotation == 0)
evas_object_move(ee->prop.cursor.object,
@ -2577,25 +2579,25 @@ _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timest
y - fy - ee->prop.cursor.hot.y);
else if (ee->rotation == 90)
evas_object_move(ee->prop.cursor.object,
ee->h - y - fx - 1 - ee->prop.cursor.hot.x,
ee->h + fw - y - fx - 1 - ee->prop.cursor.hot.x,
x - fy - ee->prop.cursor.hot.y);
else if (ee->rotation == 180)
evas_object_move(ee->prop.cursor.object,
ee->w - x - fx - 1 - ee->prop.cursor.hot.x,
ee->h - y - fy - 1 - ee->prop.cursor.hot.y);
ee->w + fw - x - fx - 1 - ee->prop.cursor.hot.x,
ee->h + fh - y - fy - 1 - ee->prop.cursor.hot.y);
else if (ee->rotation == 270)
evas_object_move(ee->prop.cursor.object,
y - fx - ee->prop.cursor.hot.x,
ee->w - x - fy - 1 - ee->prop.cursor.hot.y);
ee->w + fh - x - fy - 1 - ee->prop.cursor.hot.y);
}
if (ee->rotation == 0)
evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
else if (ee->rotation == 90)
evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
evas_event_feed_mouse_move(ee->evas, ee->h + fw - y - 1, x, timestamp, NULL);
else if (ee->rotation == 180)
evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
evas_event_feed_mouse_move(ee->evas, ee->w + fw - x - 1, ee->h + fh - y - 1, timestamp, NULL);
else if (ee->rotation == 270)
evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
evas_event_feed_mouse_move(ee->evas, y, ee->w + fh - x - 1, timestamp, NULL);
}
EAPI void