NativeDisplayBrightness
NativeDisplayBrightness copied to clipboard
Support for multiple monitors
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.
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.
@bensge And what option should do? I’m just implementing this..
@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
@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.
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: https://github.com/Bensge/NativeDisplayBrightness/pull/8