twinkle-tray icon indicating copy to clipboard operation
twinkle-tray copied to clipboard

Re-set monitor brightness after monitor returns from power saving mode.

Open mclarence opened this issue 3 years ago • 6 comments

Hello,

When I set the monitor brightness through the app and let the monitor sleep and wake again, the brightness is very bright and I have to always adjust the brightness again through the app.

Is there a way for the app to detect if the brightness has changed on the monitor and if it has, set it to what the user has set the brightness to before?

Thanks!

mclarence avatar Mar 16 '21 09:03 mclarence

Maybe your monitor forgets the set brightness, and returns to the one set using it's OSD. You can set your monitor brightness (on the monitor itself) to 0%, so it's not blindingly bright as a workaround.

Susko3 avatar May 08 '21 17:05 Susko3

My monitor does that too - after coming back from sleep, it uses its OSD brightness setting. One needs to play with the Twinkle Tray slider to fix it.

Maybe Twinkle Tray should re-push the brightness value each time the monitor wakes up.

vriesk avatar May 11 '21 10:05 vriesk

It's possible that listening for the SC_MONITORPOWER Windows event may detect the situation you're describing, but I haven't been able to successfully bind a listener for it yet.

xanderfrangos avatar May 13 '21 19:05 xanderfrangos

After additional research and testing, I don't think it'll be possible to do this properly. If someone can provide a proof-of-concept of listening for monitors waking up, it would be greatly appreciated. Currently, Twinkle Tray will re-apply the last known brightness after waking up from sleep/hibernation, but not when Windows simply stops sending a signal. To my understanding, the SC_MONITORPOWER event is what needs to be hooked, but I'm not 100% sure.

Twinkle Tray doesn't have a way to get notified that the brightness has changed on a monitor. The only way to detect it is to poll the monitors every few seconds, which would spike CPU usage. This mean that, unfortunately, there isn't anything I can do here.

@Susko3's suggestion Is probably the best option for users who face the same issue as @mclarence.

I'll leave this issue open for a little while in case someone has code to contribute.

xanderfrangos avatar May 14 '21 02:05 xanderfrangos

I have this issue as well and If I remember correctly, ClickMonitorDDC didn't have this issue.

Eliasyoussef47 avatar Oct 12 '21 16:10 Eliasyoussef47

I also have this issue. Monitor goes back to the OSD brightness setting after waking up from sleep.

From Windows settings (Settings -> System -> Power and Sleep), Monitor is set to go to sleep after 10 minutes of inactivity, and PC goes to sleep after 30 minutes.

It does not matter if PC goes to sleep or not. Every time the monitor goes to sleep (after 10 minutes or so) the brightness changes.

TheGeek420 avatar Mar 20 '22 08:03 TheGeek420