aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-11-21 12:14:12 -0500
committerChris Michael <cp.michael@samsung.com>2018-01-31 11:18:03 -0500
commit25004e6555b3991601d2ec5e544ede33a8044d50 (patch)
treec6c146e2a7555f7a0f83f2996b01bb9e08ba706d
parentecore-drm2: Add API function to get/set output relative mode (diff)
downloadefl-25004e6555b3991601d2ec5e544ede33a8044d50.tar.gz
ecore-evas-drm: Account for output relative position when getting screen geometry
When we are calculating screen geometry, we should be using output relative position in order to get the proper screen size. If screens were stacked above/below, the previous code here would return an incorrect screen geometry. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 1b9d7d5f0b..47be7ea311 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -427,9 +427,27 @@ _drm_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y, int *
EINA_LIST_FOREACH(outputs, l, output)
{
+ int relative;
+
+ relative = ecore_drm2_output_relative_get(output);
ecore_drm2_output_info_get(output, NULL, NULL, &ow, &oh, NULL);
- if (w) *w += MAX(*w, ow);
- if (h) *h = MAX(*h, oh);
+ switch (relative)
+ {
+ case ECORE_DRM2_RELATIVE_TO_LEFT:
+ case ECORE_DRM2_RELATIVE_TO_RIGHT:
+ if (w) *w += MAX(*w, ow);
+ if (h) *h = MAX(*h, oh);
+ break;
+ case ECORE_DRM2_RELATIVE_TO_ABOVE:
+ case ECORE_DRM2_RELATIVE_TO_BELOW:
+ if (w) *w = MAX(*w, ow);
+ if (h) *h += MAX(*h, oh);
+ break;
+ default:
+ if (w) *w += MAX(*w, ow);
+ if (h) *h = MAX(*h, oh);
+ break;
+ }
}
}