From 3db9434a48483bb0a03db10cee9f9a96239662a6 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 10 Oct 2012 08:45:00 +0000 Subject: [PATCH] E (RandR): When we search for a resolution, if we did not find one which matched the existing refresh rate, then search again but do not take refresh rate into account. NB: Should fix Raster's "resolution not changing" problem. Signed-off-by: Christopher Michael SVN revision: 77724 --- src/modules/conf_randr/e_smart_monitor.c | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index 40a091e04..ab7786715 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -1368,6 +1368,34 @@ _e_smart_monitor_resolution_get(E_Smart_Data *sd, Evas_Coord width, Evas_Coord h } } + /* if we got here, then no mode was found which matched on refresh rate. + * Search again, this time ignoring refresh rate */ + /* find the closest resolution we have, within 'fuzziness' range */ + EINA_LIST_REVERSE_FOREACH(sd->modes, l, mode) + { + if ((((int)mode->width - RESIZE_SNAP_FUZZINESS) <= width) || + (((int)mode->width + RESIZE_SNAP_FUZZINESS) <= width)) + { + if ((((int)mode->height - RESIZE_SNAP_FUZZINESS) <= height) || + (((int)mode->height + RESIZE_SNAP_FUZZINESS) <= height)) + { + double rate = 0.0; + + /* since we did not match on refresh rate, then we need + * to update the smart data struct with the rate + * from this mode */ + if ((mode->hTotal) && (mode->vTotal)) + { + sd->rate = (int)((float)sd->mode->dotClock / + ((float)sd->mode->hTotal * + (float)sd->mode->vTotal)); + } + + return mode; + } + } + } + return NULL; }