From 373bd3ce00b5d2eb1a21e1911f5bea260c731afc Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 17 Dec 2012 15:46:55 +0000 Subject: [PATCH] Add function for a monitor to apply it's changes. NB: This is needed because apparently the e_randr serialization code works DIRECTLY on the E_Randr_Info structures (E_Randr_Output_Info, etc, etc). Sooo, in order to save and restore a randr config, we need for the monitor to update those structures First before we tell e_randr to save things else it will save with incorrect values. NB: This is the START of save/restore configuration work. Signed-off-by: Christopher Michael SVN revision: 81161 --- src/modules/conf_randr/e_smart_monitor.c | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index 9aa639763..fe5250c57 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -401,6 +401,32 @@ e_smart_monitor_changes_reset(Evas_Object *obj) sd->orig.enabled = sd->current.enabled; } +void +e_smart_monitor_changes_apply(Evas_Object *obj) +{ + E_Smart_Data *sd; + E_Randr_Crtc_Info *crtc; + + /* try to get the objects smart data */ + if (!(sd = evas_object_smart_data_get(obj))) return; + + if (!(crtc = sd->output->crtc)) + { + /* FIXME: What to do in this case ?? */ + ERR("NO CRTC FOR MONITOR !!\n"); + + 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; + + crtc->current_mode = sd->current.mode; + crtc->current_orientation = sd->current.orientation; +} + void e_smart_monitor_current_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) {