Tyrrrz / LightBulb

Reduces eye strain by adjusting screen gamma based on the current time
MIT License
2.23k stars 141 forks source link

Configuration is disabled when returning to a computer after accessing it via Remote Desktop #294

Closed LilithSilver closed 4 months ago

LilithSilver commented 4 months ago

Version

v2.4.12

Platform

Windows 10

Steps to reproduce

Step 1: On the host computer, enable LightBulb. Step 2: On a client computer, connect to the host computer with Remote Desktop Protocol (RDP). Step 3: Close the connection. Step 4: Return to the host computer, and log in. Observe that LightBulb is disabled. Step 5: Change some configuration of LightBulb, for example toggling its visibility with a hotkey. Observe that, with the hotkey, two keypresses are needed to properly enable it again.

Details

Expected behavior: LightBulb's filter remains in the previous configuration.

Actual behavior: LightBulb's filter is disabled until the configuration is adjusted somehow.

Not sure how to address this one. Perhaps a SENS event to update the configuration at login?

Happy to take a look at this if you have a recommendation for a fix. Otherwise, if you don't have access to RDP on your version of Windows, you can use RDPWrap. For access, you can use any Windows computer, or the Remote Desktop app from Windows on iOS or Android.

Checklist

Tyrrrz commented 4 months ago

We currently track a bunch of different system events that indicate various changes in display settings: https://github.com/Tyrrrz/LightBulb/blob/c61bc946e86a3a826c600e36ef2a285bdf252314/LightBulb/Services/GammaService.cs#L30-L86

Unfortunately, it doesn't seem to cover every case -- some system changes don't trigger any events. This is basically why polling exists, as a workaround for this issue.

If you manage to find a way to refresh gamma reactively for this case, I'm happy if you can submit a PR.

LilithSilver commented 4 months ago

I had a hunch that gamma polling wasn't actually working properly for my install -- and indeed, a completely fresh install of LightBulb fixed it. I wish I knew what was causing it, since there might be a deeper issue there. But I can't reproduce the bug, so I'm closing #294 and #295 (which was the same thing). In the future I'll try a portable install before submitting an issue!