From f53cc4a5f2dae6cb5cf40c3d1d59da89b0b84c28 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Tue, 19 Feb 2013 10:58:01 +0000 Subject: [PATCH] Backport: 5b47415 :: Add code to check if rotations for a given crtc are possible, and disable the rotation in edje if not. Signed-off-by: Christopher Michael SVN revision: 84176 Signed-off-by: Deon Thomas --- src/modules/conf_randr/e_smart_monitor.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index 70a84373c..fc2c95ad7 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -152,6 +152,8 @@ void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch) { E_Smart_Data *sd; + Ecore_X_Randr_Orientation orients; + Ecore_X_Window root = 0; LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -172,6 +174,16 @@ e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord c /* set monitor resolution text */ _e_smart_monitor_resolution_set(sd, sd->cw, sd->ch); + + /* get the root window */ + root = ecore_x_window_root_first_get(); + + /* get possible orientations for this crtc */ + orients = ecore_x_randr_crtc_orientations_get(root, crtc); + + /* check if orientation is possible and disable if not */ + if (orients <= ECORE_X_RANDR_ORIENTATION_ROT_0) + edje_object_signal_emit(sd->o_frame, "e,state,rotate,disabled", "e"); } void