From a6e9392068db90292fd616bc3c0024bfe6c8094d Mon Sep 17 00:00:00 2001 From: Maciej Kisielewski Date: Mon, 11 Jun 2018 14:45:38 +0200 Subject: xrandr_cycle: fix testing of weird resolutions xrandr can list modes that are unsupported, unity-control-center defines minimum width and height, below which the resolution is not listed as a choice in display settings panel in UCC see should_show_resolution function in cc-display-panel.c from lp:unity-control-center Fixes: LP: #1627581 Signed-off-by: Maciej Kisielewski --- bin/xrandr_cycle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/xrandr_cycle b/bin/xrandr_cycle index b9f615b..34f953c 100755 --- a/bin/xrandr_cycle +++ b/bin/xrandr_cycle @@ -87,6 +87,13 @@ for adapter, mode in modes: highest_modes = [] for adapter, params in top_res_per_aspect.items(): for aspect, width in params.items(): + # xrandr can list modes that are unsupported, unity-control-center + # defines minimum width and height, below which the resolution + # is not listed as a choice in display settings panel in UCC + # see should_show_resolution function in cc-display-panel.c + # from lp:unity-control-center + if width < 675 or width / aspect < 530: + continue mode = '{}x{}'.format(width, width/aspect) highest_modes.append((adapter, mode)) -- cgit v1.2.3