diff options
author | Rafael Antognolli <rafael.antognolli@intel.com> | 2013-04-24 17:56:53 -0300 |
---|---|---|
committer | Rafael Antognolli <rafael.antognolli@intel.com> | 2013-04-24 17:56:53 -0300 |
commit | 72bbf5b49b449929ad1e12b15055eea35629e804 (patch) | |
tree | 037ae89a7b0b6f508076c267dad19a8e0b13bb21 | |
parent | f18174f30248dde2e2f9afb662f05f6709bd40e3 (diff) | |
download | efl-72bbf5b49b449929ad1e12b15055eea35629e804.tar.gz |
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.
-rw-r--r-- | src/lib/ecore_evas/ecore_evas.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 114007e402..6e434512c2 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -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 |