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

Support for multiple monitors #5

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Support for multiple monitors #5

wants to merge 8 commits into from

Conversation

jlj
Copy link

@jlj jlj commented Aug 10, 2017

Hi,

This pull request contains a number of improvements centered around the support of multiple external displays.

In summary (extract from the commits):

  • Manage the brightness individually for each connected external monitor. The brightness adjustment is done on the monitor with the currently active window, and the brightness system UI is displayed on the adjusted monitor.
  • Read the brightness from the target monitor via DDC/CI if supported; otherwise maintain a @[display_id: brightness] dictionary in the user defaults.
  • Display the Brightness system OSD on the target monitor.
  • If the app is not trusted in the Accessibility preference panel when started, it now waits that the user trusts it before installing the key event monitor. Previously the app had to be relaunched after being authorized to grab the keys, which was not user-friendly at all, because that the app is invisible and had to be killed via the Activity Monitor!!
  • Show the brightness level pane on the target display if the brightness level is not actually changed because already at the min or max level.
  • Upgraded DDC to a more-recent version.
  • [Internal] Declare C functions and variables as static in AppDelegate.m to better express their expected scope.
  • [Internal] Removed useless CoreGraphicsPriv.h.

- Manage the brightness individually for each connected external monitor.
- Read the brightness from the target monitor if available; otherwise maintain a @[display_id: brightness] dictionary in the user defaults.
- Display the Brightness system OSD on the target monitor.
- Upgraded DDC to a more-recent version.
- Removed useless CoreGraphicsPriv.h.
If the app is not trusted in the Accessibility preference panel when started, it now waits that the user trusts it before installing the key event monitor. Previously the app had to be relaunched after being authorized to grab the keys, which was not user-friendly at all, because that the app is invisible and had to be killed via the Activity Monitor!!
- Waiting for accessibility authorization is now done using the selector-based NSTimer API, making it work on macOS versions < 10.12.
- Updated version information and copyright.
- Show the brightness level pane on the target display if the brightness level is not actually changed because already at the min or max level.
- [Internal] Declare C functions and variable as static in AppDelegate.m to better express their expected scope.
- Rewritten management of the brightness level, so that possible brightness levels are evenly distributed in the monitor's possible range.
- Added the support of quarter-step adjustments when the Option modifier key is pressed (similar to the system brightness management on the internal display when  Shift+Option is pressed).
@Bensge
Copy link
Owner

Bensge commented Sep 6, 2017

Sorry for the late reply on this PR. I appreciate the PR and will test it asap.
About the support for multi-monitor setups:
I am running a setup with two monitors and I like the way the app changes the brightness of all monitors at the same time, but I can see that it won't work very well with different monitors. I think we need to add a preference panel to allow users to chose either option.

@Volodymyr-13
Copy link

@Bensge And what option should do? I’m just implementing this..

@Bensge
Copy link
Owner

Bensge commented Jan 28, 2018

@KAMIKAZEUA the option should allow the user to chose one of the following behaviors:

  • set the brightness of all monitors at the same time
  • adjust the brightness of each monitor separately

@Volodymyr-13
Copy link

@Bensge Okay, I will create it, but I don't know yet where I can use it in a code :)
I want to improve this app, I've already added NSStatusBar menu. Currently working on adding UI window - settings and also I want to add menu items with brightness settings.

Next plan - add controls for color temperature, because I'm using these options always at the same time. But this option can be disabled in settings. Thats the plan.

@Volodymyr-13
Copy link

Volodymyr-13 commented Jan 28, 2018

So, how to get list of monitors? I have only one..
@jlj Maybe you can help? I've used your modifications as base. I like them all.

@jlj @Bensge UPD: #8

- Brightness adjustment now targets the main screen if the `shift` key modifier is not pressed, and all screens if `shift` is pressed in conjunction with F1 or F2.
- Display the native brightness OSD on every adjusted screen.
- Support brightness adjustment of the builtin screen with F1 / F2 for consistency with external screens.
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