Windows 10 Night Light

My game is a 2D game that I run using Exclusive Screen Mode on Windows. I notice that when the Night Light setting on Windows 10 is in effect, the game is not color adjusted when it starts up. But if I switch the game out using, say, the Windows key, the game is thereafter adjusted if Night Light is in effect.

The problem is both the lack of control and the inconsistency. I am curious if anyone else has thoughts about this.

I also notice that if I force the OpenGL pipeline to be used then the game is color adjusted from the beginning.

I use a plain AWT Frame and no other AWT or swing components. Ultimately I wonder if this is a JVM issue or a Windows issue? The JVM will restore the Exclusive Screen Mode by itself when the game is made active from the minimized state. I like that because it’s nice for players to minimize the game and read the manual or look up something online and then return to the game. Now this business of the Night Light makes it a little weird when that is in effect.

OK, I have solved this and the solution is admittedly pretty obvious.

In short: reset the exclusive screen mode (GraphicsDevice.setFullScreenWindow()) after the game is reactivated.

The longer version is that I made sure to
set the exclusive screen window to null,
disposed of the existing BufferStrategy
rebuilt the BufferStrategy
set the exclusive screen window to my Frame
reallocated any Volatile images that I need to
resume the game

Some of that may not really be necessary. But it does work and now my game doesn’t get recolored with the Night Light.

Hopefully this will help someone else down the road. If anyone on Earth besides me is still using Java2D that is. ;D