antognolli pushed a commit to branch ecore-1.7.
commit 81c35ac110a8a7e57892d6db4308b23f87c6e607
Author: Rafael Antognolli <[email protected]>
Date: Tue Apr 2 23:45:10 2013 -0300
backport: 97d06e5b3f4b658d60ef9ff2e3d1d81ce86cb3b3
ecore/wayland: Fix screen geometry when it is rotated.
Width and height should be swapped when the screen is rotated by 90 or
270 degrees.
Additionally, add a command to the ecore_evas_window_sizes_example which
returns the screen geometry.
---
src/lib/ecore_wayland/Ecore_Wayland.h | 1 +
src/lib/ecore_wayland/ecore_wl.c | 16 ++++++++++++++++
src/lib/ecore_wayland/ecore_wl_output.c | 3 ++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h
b/src/lib/ecore_wayland/Ecore_Wayland.h
index 621f35b..98093f1 100644
--- a/src/lib/ecore_wayland/Ecore_Wayland.h
+++ b/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -127,6 +127,7 @@ struct _Ecore_Wl_Output
Ecore_Wl_Display *display;
struct wl_output *output;
Eina_Rectangle allocation;
+ int transform;
int mw, mh;
struct wl_list link;
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index a20d97f..68437b6 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -320,6 +320,22 @@ ecore_wl_screen_size_get(int *w, int *h)
if (!_ecore_wl_disp->output) return;
+ switch (_ecore_wl_disp->output->transform)
+ {
+ case WL_OUTPUT_TRANSFORM_90:
+ case WL_OUTPUT_TRANSFORM_270:
+ case WL_OUTPUT_TRANSFORM_FLIPPED_90:
+ case WL_OUTPUT_TRANSFORM_FLIPPED_270:
+ /* Swap width and height */
+ if (w) *w = _ecore_wl_disp->output->allocation.h;
+ if (h) *h = _ecore_wl_disp->output->allocation.w;
+ break;
+ default:
+ if (w) *w = _ecore_wl_disp->output->allocation.w;
+ if (h) *h = _ecore_wl_disp->output->allocation.h;
+ }
+
+
if (w) *w = _ecore_wl_disp->output->allocation.w;
if (h) *h = _ecore_wl_disp->output->allocation.h;
}
diff --git a/src/lib/ecore_wayland/ecore_wl_output.c
b/src/lib/ecore_wayland/ecore_wl_output.c
index 127dfac..1559531 100644
--- a/src/lib/ecore_wayland/ecore_wl_output.c
+++ b/src/lib/ecore_wayland/ecore_wl_output.c
@@ -80,7 +80,7 @@ _ecore_wl_output_del(Ecore_Wl_Output *output)
/* local functions */
static void
-_ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output
__UNUSED__, int x, int y, int w, int h, int subpixel __UNUSED__, const char
*make __UNUSED__, const char *model __UNUSED__, int transform __UNUSED__)
+_ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output
__UNUSED__, int x, int y, int w, int h, int subpixel __UNUSED__, const char
*make __UNUSED__, const char *model __UNUSED__, int transform)
{
Ecore_Wl_Output *output;
@@ -91,6 +91,7 @@ _ecore_wl_output_cb_geometry(void *data, struct wl_output
*wl_output __UNUSED__,
output->allocation.y = y;
output->mw = w;
output->mh = h;
+ output->transform = transform;
}
static void
--
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html