]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - autorandr.py
typo
[deb_pkgs/autorandr.git] / autorandr.py
index 9dea362b1baf7e94b7649a22f5a36bff7bf4097f..8053b12c0e0ebe3f0b4dcf5a81b0a3f7f1b66a77 100755 (executable)
@@ -462,6 +462,13 @@ def apply_configuration(configuration, dry_run=False):
         else:
             disable_outputs = disable_outputs[-1:]
 
+    # If disable_outputs still has more than one output in it, one of the xrandr-calls below would
+    # disable the last two screens. This is a problem, so if this would happen, instead disable only
+    # one screen in the first call below.
+    if len(disable_outputs) > 0 and len(disable_outputs) % 2 == 0:
+        # In the context of a xrandr call that changes the display state, `--query' should do nothing
+        disable_outputs.insert(0, ['--query'])
+
     # Enable the remaining outputs in pairs of two operations
     operations = disable_outputs + enable_outputs
     for index in range(0, len(operations), 2):