From 9e2fb834b9942ff6a98247ac20117faa02406f29 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Tue, 18 Dec 2012 11:13:49 +0000 Subject: [PATCH] When telling the monitor to apply changes we should check to see what actually changed and update things accordingly. Signed-off-by: Christopher Michael SVN revision: 81236 --- src/modules/conf_randr/e_smart_monitor.c | 42 ++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index 856967a51..10d636af0 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -278,6 +278,7 @@ e_smart_monitor_setup(Evas_Object *obj) else { /* FIXME: NB: TODO: Handle case of output not having crtc */ + printf("Output Has NO Crtc !!\n"); } /* set the original rotation */ @@ -419,13 +420,42 @@ e_smart_monitor_changes_apply(Evas_Object *obj) return; } - crtc->geometry.x = sd->current.x; - crtc->geometry.y = sd->current.y; - crtc->geometry.w = sd->current.w; - crtc->geometry.h = sd->current.h; + /* if nothing changed, we have nothing to apply */ + if (sd->changes == 0) return; - crtc->current_mode = sd->current.mode; - crtc->current_orientation = sd->current.orientation; + /* check if it changed position and update values */ + if (sd->changes & E_SMART_MONITOR_CHANGED_POSITION) + { + crtc->geometry.x = sd->current.x; + crtc->geometry.y = sd->current.y; + } + + /* check if it changed size and update values */ + if (sd->changes & E_SMART_MONITOR_CHANGED_RESOLUTION) + { + crtc->geometry.w = sd->current.w; + crtc->geometry.h = sd->current.h; + } + + /* check if it changed mode or refresh rate and update values */ + if ((sd->changes & E_SMART_MONITOR_CHANGED_MODE) || + (sd->changes & E_SMART_MONITOR_CHANGED_REFRESH)) + crtc->current_mode = sd->current.mode; + + /* check if it changed orientation and update values */ + if (sd->changes & E_SMART_MONITOR_CHANGED_ROTATION) + crtc->current_orientation = sd->current.orientation; + + /* if this monitor is cloned, use the parent geometry */ + if (sd->cloned) + { + e_smart_monitor_current_geometry_get(sd->parent, &crtc->geometry.x, + &crtc->geometry.y, + &crtc->geometry.w, + &crtc->geometry.h); + } + + /* TODO: Handle enabled and crtc change */ } void