diff options
author | Maciej Kisielewski <maciej.kisielewski@canonical.com> | 2018-06-11 14:45:38 +0200 |
---|---|---|
committer | Maciej Kisielewski <maciej.kisielewski@canonical.com> | 2018-06-11 14:45:38 +0200 |
commit | a6e9392068db90292fd616bc3c0024bfe6c8094d (patch) | |
tree | 5e095ed612f1c12a9c97348c7ca2da2ecc53228b | |
parent | 680e31866f3533510ec5f4293471c7804f3ce2ae (diff) |
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 <maciej.kisielewski@canonical.com>
-rwxr-xr-x | bin/xrandr_cycle | 7 |
1 files changed, 7 insertions, 0 deletions
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)) |