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

Conversation

madduck
Copy link
Contributor

@madduck madduck commented Sep 10, 2019

The way autorandr previously used to generate one gigantic xrandr call with multiple --outputs wouldn't work reliably. In some setups, I'd consistently get:

xrandr: Configure crtc 1 failed"

whereas running two xrandr calls, one for each display, works.

This patch simply dispatches one xrandr call per display.

The way autorandr previously used to generate one gigantic xrandr call
with multiple --outputs wouldn't work reliably. In some setups, I'd
consistently get:

  "xrandr: Configure crtc 1 failed"

whereas running two xrandr calls, one for each display, works.

This patch simply dispatches one xrandr call per-display.

Signed-off-by: martin f. krafft <madduck@madduck.net>
@hensur
Copy link

hensur commented Sep 11, 2019

I just ran into the same issue. This branch fixed the xrandr errors!

@@ -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

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?

@phillipberndt
Copy link
Owner

There's drivers that'll automatically reenable one output, and also window managers unhappy about having everything disabled.

@madduck
Copy link
Contributor Author

madduck commented Sep 14, 2019

Okay, I'll see when I can take another look at the code. I'm now travelling with just a single screen, so…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants