Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

fixed brightness when using external screens #24

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

Conversation

clemenstyp
Copy link

I fixed the brightness, so that is cycles through all displays and changes the build-in one.
The last solution did not work, when you had a second screen attached, that you used a your main display.

@billziss-gh
Copy link
Owner

Thanks. I will take a look at this some time later in the week.

Copy link
Owner

@billziss-gh billziss-gh left a comment

Choose a reason for hiding this comment

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

Please take a look at the requested changes.

@@ -16,6 +16,9 @@
#include <pthread.h>
#include "Log.h"

int DisplayServicesSetBrightnessWithType( int, int, int, int); //now the compiler knows, what the signature looks like.
Copy link
Owner

Choose a reason for hiding this comment

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

This is not used anywhere. Please remove.

kern_return_t ret = KERN_RETURN_MAX;
err = CGGetOnlineDisplayList(8, displayIDs, &max);
if(err != kCGErrorSuccess) {
Copy link
Owner

Choose a reason for hiding this comment

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

Please try to maintain the same code style as the rest of the project. In this project left braces ({) go to the next line.


err = CGGetOnlineDisplayList(8, displayIDs, &max);
if(err != kCGErrorSuccess) {
false;
Copy link
Owner

Choose a reason for hiding this comment

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

This should be return false;.

@billziss-gh
Copy link
Owner

In addition to my comments above your patch changes EnergyBar to control the builtin display instead of the main display.

  • I am not sure what the correct behavior is but why should the brightness slider control the brightness of the builtin display and not the main display?
  • What do the default brightness control in macOS do? Do they control the builtin display or the main one? I believe EnergyBar should do the same.

@evanrobertson
Copy link
Contributor

@billziss-gh @clemenstyp The default touchbar behaviour appears to change the built in display for me when using an external monitor, at the same time however my external doesn't offer software brightness control.

It would be good if we had a setting at least that let EnergyBar change the built in diplays brightness rather than the main display.

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

Successfully merging this pull request may close these issues.

None yet

3 participants