Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call xrandr individually for each display #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions autorandr.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,8 @@ def apply_configuration(new_configuration, current_configuration, dry_run=False)

# Enable the remaining outputs in pairs of two operations
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the comment

operations = disable_outputs + enable_outputs
for index in range(0, len(operations), 2):
argv = base_argv + list(chain.from_iterable(operations[index:index + 2]))
for op in operations:
argv = base_argv + list(op)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going one by one is an issue if there's still an output to disable, because then the first call would disable the last output. You'll have to add code like

if disable_outputs:
    do a single call that disables the remaining outputs and enables the first output

and then handles the remaining ones one by one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what you're saying, but I don't see the problem. XRandR works fine if there's not a single output active. So even if all outputs get disabled, the fact that there are calls queued that will enable them again, should make this a safe operation, no?

if call_and_retry(argv, dry_run=dry_run) != 0:
raise AutorandrException("Command failed: %s" % " ".join(argv))

Expand Down