From 4e9dd83e4453f7962e387becbceb520eee5b97fc Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Fri, 28 Sep 2012 12:43:43 +0000 Subject: [PATCH] E (RandR): Fix corner case where rotation was done by user for a full 360 degrees and snapping was incorrect. SVN revision: 77204 --- src/modules/conf_randr/e_smart_monitor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index 09a5c0d35..fb28ff94f 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -918,9 +918,13 @@ _e_smart_monitor_orientation_get(E_Smart_Data *sd) degree = sd->rotation; if (degree < 0) degree += 360; + else if (degree > 360) degree -= 360; /* find the closest degree of rotation within 'fuzziness' tolerance */ - if (((degree - ROTATE_SNAP_FUZZINESS) <= 90) || + if (((degree - ROTATE_SNAP_FUZZINESS) <= 0) || + ((degree + ROTATE_SNAP_FUZZINESS) <= 0)) + return 0; + else if (((degree - ROTATE_SNAP_FUZZINESS) <= 90) || ((degree + ROTATE_SNAP_FUZZINESS) <= 90)) return 90; else if (((degree - ROTATE_SNAP_FUZZINESS) <= 180) ||