import copy
import getopt
import hashlib
+import math
import os
import posix
import pwd
o_height = int(detail.get("h")) + int(detail.get("y"))
width = max(width, o_width)
height = max(height, o_height)
- return int(width), int(height)
+ return math.ceil(width), math.ceil(height)
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 = []
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: