X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=f22b218e7e2f5094c8572033d32f50a9ae570fe1;hb=4653ea6c5d8bf98bd8e2f34fe8a225f6abdbd3a5;hp=fe1906d16e83b2fed2f71ddbee8592eee1ce6ff9;hpb=ffd20489a2beacecf295f138dcfb9f6106d6a606;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index fe1906d..f22b218 100755 --- a/autorandr.py +++ b/autorandr.py @@ -889,10 +889,10 @@ def apply_configuration(new_configuration, current_configuration, dry_run=False) fb_dimensions = get_fb_dimensions(new_configuration) try: - base_argv += ["--fb", "%dx%d" % fb_dimensions] + fb_args = ["--fb", "%dx%d" % fb_dimensions] except: # Failed to obtain frame-buffer size. Doesn't matter, xrandr will choose for the user. - pass + fb_args = [] auxiliary_changes_pre = [] disable_outputs = [] @@ -942,6 +942,11 @@ def apply_configuration(new_configuration, current_configuration, dry_run=False) if call_and_retry(argv, dry_run=dry_run) != 0: raise AutorandrException("Command failed: %s" % " ".join(argv)) + # Starting here, fix the frame buffer size + # Do not do this earlier, as disabling scaling might temporarily make the framebuffer + # dimensions larger than they will finally be. + base_argv += fb_args + # Disable unused outputs, but make sure that there always is at least one active screen disable_keep = 0 if remain_active_count else 1 if len(disable_outputs) > disable_keep: