From 43dea93969409bcd4f5fefa79debd4d9e9350bb6 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 30 Jun 2017 10:25:24 -0400 Subject: [PATCH] handle rotations with fake xinerama screens --- src/bin/e_comp_wl.c | 46 +++++++++++++++++++++++++------------------- src/bin/e_xinerama.h | 1 + 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index e46ae9482..99a4da4cc 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1107,12 +1107,34 @@ _e_comp_wl_client_evas_init(E_Client *ec) ec->comp_data->evas_init = EINA_TRUE; } +static inline int +_rotation_get(int rotation) +{ + int transform; + switch (rotation) + { + case 90: + transform = WL_OUTPUT_TRANSFORM_90; + break; + case 180: + transform = WL_OUTPUT_TRANSFORM_180; + break; + case 270: + transform = WL_OUTPUT_TRANSFORM_270; + break; + case 0: + default: + transform = WL_OUTPUT_TRANSFORM_NORMAL; + break; + } + return transform; +} + static Eina_Bool _e_comp_wl_cb_randr_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED) { const Eina_List *l; E_Randr2_Screen *screen; - unsigned int transform = WL_OUTPUT_TRANSFORM_NORMAL; if (!e_randr2) return ECORE_CALLBACK_RENEW; @@ -1123,7 +1145,7 @@ _e_comp_wl_cb_randr_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *e { e_comp_wl_output_init(NULL, NULL, NULL, scr->x, scr->y, scr->w, scr->h, - 0, 0, 0, 0, 0, scr->escreen); + 0, 0, 0, 0, _rotation_get(scr->rotation), scr->escreen); } return ECORE_CALLBACK_RENEW; } @@ -1135,29 +1157,13 @@ _e_comp_wl_cb_randr_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *e continue; } - switch (screen->config.rotation) - { - case 90: - transform = WL_OUTPUT_TRANSFORM_90; - break; - case 180: - transform = WL_OUTPUT_TRANSFORM_180; - break; - case 270: - transform = WL_OUTPUT_TRANSFORM_270; - break; - case 0: - default: - transform = WL_OUTPUT_TRANSFORM_NORMAL; - break; - } - if (!e_comp_wl_output_init(screen->id, screen->info.name, screen->info.screen, screen->config.geom.x, screen->config.geom.y, screen->config.geom.w, screen->config.geom.h, screen->info.size.w, screen->info.size.h, - screen->config.mode.refresh, screen->info.subpixel, transform, 0)) + screen->config.mode.refresh, screen->info.subpixel, + _rotation_get(screen->config.rotation), 0)) ERR("Could not initialize screen %s", screen->info.name); } diff --git a/src/bin/e_xinerama.h b/src/bin/e_xinerama.h index ea0037cf1..b886cf9b0 100644 --- a/src/bin/e_xinerama.h +++ b/src/bin/e_xinerama.h @@ -10,6 +10,7 @@ struct _E_Screen { int screen, escreen; int x, y, w, h; + int rotation; char *id; // this is the same id we get from randr2 so look it up there };