Trouble with Dark Mode

My app calls Color.IsDarkMode for custom controls and otherwise uses Color.TextColor etc. to use system colours where appropriate. It responds correctly to Dark Mode being turned on or off on my machine running Catalina.

However, a user has just reported that on his Catalina machine with General Appearance setting on Auto using Night Shift, his desktop is not in Dark Mode, but the App is displaying in Dark Mode.

Anyone know what’s going on?

Could it be that he has turned it off manually while it was automaticly turned on?
Maybe some race condition happened?

Does it show in dark mode directly if he starts the app, while he is still in light mode (on the system) ?

Yes. He sent a video of exactly that happening.

Sounds like some kind of flag didn’t change. what happens if you call Color.IsDarkmode a couple times at his system ?>

Oh, wait a minute … since it sounded unbelievable again when I typed it out, I just checked his video again. His System menubar is clearly displaying white text on a dark background. That is Dark Mode. So this is just user error, looks like he’s confused by his system setting of “Auto”.

1 Like

That could be, since “Auto” would change it depending on the “Time” setting.

Exactly. I can see how it could be a little confusing.

His system was switching between modes not according to time (which would be predictable) but according to ambient lighting. That’s why he was confused.

2 Likes
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.