summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-04-24 17:56:53 -0300
committerRafael Antognolli <rafael.antognolli@intel.com>2013-04-24 17:56:53 -0300
commit72bbf5b49b449929ad1e12b15055eea35629e804 (patch)
tree037ae89a7b0b6f508076c267dad19a8e0b13bb21
parentf18174f30248dde2e2f9afb662f05f6709bd40e3 (diff)
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.c20
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 114007e..6e43451 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)
2564EAPI void 2564EAPI void
2565_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp) 2565_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
2566{ 2566{
2567 int fx, fy, fw, fh;
2567 ee->mouse.x = x; 2568 ee->mouse.x = x;
2568 ee->mouse.y = y; 2569 ee->mouse.y = y;
2570
2571 evas_output_framespace_get(ee->evas, &fx, &fy, &fw, &fh);
2572
2569 if (ee->prop.cursor.object) 2573 if (ee->prop.cursor.object)
2570 { 2574 {
2571 int fx, fy;
2572 evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
2573 evas_object_show(ee->prop.cursor.object); 2575 evas_object_show(ee->prop.cursor.object);
2574 if (ee->rotation == 0) 2576 if (ee->rotation == 0)
2575 evas_object_move(ee->prop.cursor.object, 2577 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
2577 y - fy - ee->prop.cursor.hot.y); 2579 y - fy - ee->prop.cursor.hot.y);
2578 else if (ee->rotation == 90) 2580 else if (ee->rotation == 90)
2579 evas_object_move(ee->prop.cursor.object, 2581 evas_object_move(ee->prop.cursor.object,
2580 ee->h - y - fx - 1 - ee->prop.cursor.hot.x, 2582 ee->h + fw - y - fx - 1 - ee->prop.cursor.hot.x,
2581 x - fy - ee->prop.cursor.hot.y); 2583 x - fy - ee->prop.cursor.hot.y);
2582 else if (ee->rotation == 180) 2584 else if (ee->rotation == 180)
2583 evas_object_move(ee->prop.cursor.object, 2585 evas_object_move(ee->prop.cursor.object,
2584 ee->w - x - fx - 1 - ee->prop.cursor.hot.x, 2586 ee->w + fw - x - fx - 1 - ee->prop.cursor.hot.x,
2585 ee->h - y - fy - 1 - ee->prop.cursor.hot.y); 2587 ee->h + fh - y - fy - 1 - ee->prop.cursor.hot.y);
2586 else if (ee->rotation == 270) 2588 else if (ee->rotation == 270)
2587 evas_object_move(ee->prop.cursor.object, 2589 evas_object_move(ee->prop.cursor.object,
2588 y - fx - ee->prop.cursor.hot.x, 2590 y - fx - ee->prop.cursor.hot.x,
2589 ee->w - x - fy - 1 - ee->prop.cursor.hot.y); 2591 ee->w + fh - x - fy - 1 - ee->prop.cursor.hot.y);
2590 } 2592 }
2591 if (ee->rotation == 0) 2593 if (ee->rotation == 0)
2592 evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL); 2594 evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
2593 else if (ee->rotation == 90) 2595 else if (ee->rotation == 90)
2594 evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL); 2596 evas_event_feed_mouse_move(ee->evas, ee->h + fw - y - 1, x, timestamp, NULL);
2595 else if (ee->rotation == 180) 2597 else if (ee->rotation == 180)
2596 evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL); 2598 evas_event_feed_mouse_move(ee->evas, ee->w + fw - x - 1, ee->h + fh - y - 1, timestamp, NULL);
2597 else if (ee->rotation == 270) 2599 else if (ee->rotation == 270)
2598 evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL); 2600 evas_event_feed_mouse_move(ee->evas, y, ee->w + fh - x - 1, timestamp, NULL);
2599} 2601}
2600 2602
2601EAPI void 2603EAPI void