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

Don't set --fb when disabling outputs #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rossabaker
Copy link

I have one monitor that's bigger than my laptop's. When I undock, the --fb argument for the new configuration prevents the large monitor from shutting off in the disable_outputs pass. I think it's the same basic problem as #198.

I'm not usually a Python developer, so apologies if this is unpythonic. It works for me.

Thanks for the great tool!

rossabaker added a commit to rossabaker/cromulent that referenced this pull request Jul 30, 2020
Copy link
Owner

@phillipberndt phillipberndt left a comment

Choose a reason for hiding this comment

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

Does the approach from the ticket work for you as well? I'm referring to the one where the --fb argument is always passed, just with the old size. It'd feel safer to me to pursue that approach if it works. (There's just so many edge cases with xrandr..)

@@ -852,7 +852,11 @@ def apply_configuration(new_configuration, current_configuration, dry_run=False)
# Enable the remaining outputs in pairs of two operations
operations = disable_outputs + enable_outputs
for index in range(0, len(operations), 2):
argv = base_argv + list(chain.from_iterable(operations[index:index + 2]))
argv = base_argv
Copy link
Owner

Choose a reason for hiding this comment

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

This creates a reference to base_argv. The += below changes base_argv itself!

Copy link
Author

Choose a reason for hiding this comment

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

Oops! Yes. I'm out of practice in mutable collections.

Copy link
Author

@rossabaker rossabaker left a comment

Choose a reason for hiding this comment

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

Okay, I'll give the other approach a try when I clean up my base_argv bug.

@@ -852,7 +852,11 @@ def apply_configuration(new_configuration, current_configuration, dry_run=False)
# Enable the remaining outputs in pairs of two operations
operations = disable_outputs + enable_outputs
for index in range(0, len(operations), 2):
argv = base_argv + list(chain.from_iterable(operations[index:index + 2]))
argv = base_argv
Copy link
Author

Choose a reason for hiding this comment

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

Oops! Yes. I'm out of practice in mutable collections.

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

2 participants