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

Enable xrandr outputs one-by-one, selecting the one with --pos 0x0 first #6

Merged
merged 1 commit into from
Dec 13, 2014

Conversation

tachylatus
Copy link
Contributor

Enabling more than one or two outputs at once may result in this error:
/usr/bin/xrandr: Configure crtc 1 failed
This happens on my Dell Latitude E7440 with three monitors connected.

Disabling many outputs at once still seems safe.

Output positioning may be ignored by xrandr in some cases.
To circumvent this, make sure the output with --pos 0x0 is enabled first.

Enabling more than one or two outputs at once may result in this error:
/usr/bin/xrandr: Configure crtc 1 failed
This happens on my Dell Latitude E7440 with three monitors connected.

Disabling many outputs at once still seems safe.

Output positioning may be ignored by xrandr in some cases.
To circumvent this, make sure the output with --pos 0x0 is enabled first.
@phillipberndt
Copy link
Owner

Enabling two outputs at the same time works for you, right? We could add another sed -e '/--mode/{ N; s/\n/ /; }' to merge the outputs in pairs of two to speed things up a little.

Have you checked what happens if your monitors aren't in the correct order in the configuration file? You already have a special handler for the screen at the origin, but I believe (haven't tested though) that all outputs must be enabled in the correct order: What if you position your screens (assuming they all have a width of 1800px) such that screen 1 is at x=0, screen 2 at x=3600 and screen 3 at x=1800, and all outputs are stored in the configuration file in order 1, 2, 3. Does this work?

@tachylatus
Copy link
Contributor Author

Maybe we could merge the outputs in pairs; at least I haven't encountered issues with that, yet.

From the tests I made with my horizontal monitor layout, it seems everything will be fine as long as the origin is enabled first.
My setup produces a configuration with eDP1 at x=1920, DP2 at x=0, and DP3 at x=3840.
If I enable DP2 (origin) then DP3, there will be a gap between the screens where eDP1 is supposed to be. So, yes, it works.
If I enable DP1 or DP3 first, their position will be reset to origin, and subsequently enabled outputs will be placed relative to that.

@tachylatus
Copy link
Contributor Author

Correction:
If I enable eDP1 or DP3 first, and origin is not present, the position will be reset to origin, and subsequently enabled outputs will be placed relative to that.
.... which is the reason we want to enable origin first :-)

The gap between DP2 and DP3, until eDP1 is enabled, is just an invisible void where the cursor and any dragged windows disappear.

@phillipberndt phillipberndt merged commit f4cce4d into phillipberndt:master Dec 13, 2014
@phillipberndt
Copy link
Owner

Thanks! I've merged your changes & added 8429886 to enable the outputs in pairs.

@tachylatus
Copy link
Contributor Author

I just "yaourt -S autorandr-phillipberndt-git" the new code - works like a charm :-)

@vincentbernat
Copy link
Contributor

vincentbernat commented Nov 12, 2017

Enabling screens two by two will trigger several randr events, so there is a downside doing that. I did use the same workaround for some time, but when switching to the "modeset" driver, the problem went away. Not being able to do so is assumed to be a bug. See: https://bugs.freedesktop.org/show_bug.cgi?id=91446. So, maybe make this behavior optional? Or detect an error and fallback to the "safe" method?

@phillipberndt
Copy link
Owner

I agree that it's (obviously) a bug, but it's one many different drivers apparently have. I hence don't think it's a good idea to change the default behaviour. However, I agree that it'd be good to make this optional - that is, add a flag that allows users to disable this feature. I'll open a separate bug for that.

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