This may vary from OS and drivers.
When you toggle to minimise mode you may revert to windows/desktop mode. This can mess up gamma IF the 'full screen' setting in options is off set.
To test this, launch the game then goto options and set 'use full screen' whatever its called to no then accept.
Now you are still using game display r_gamma. Try changing r_gamma to 1.5 then 1 and see what happens. Normally 1 will be your default desktop.
Now in minimal mode...
r_ignorehwgamma 1 ; vid_restart
This will reset the game using no gamma. So if you set r_gamma 1 and notice no difference then that is your default display.
Sometimes a program in the background will kick off something and suddenly switch your gamma to the default 1. Now when that happens try a vid_restart. BUT.. to confuse things, if you went to minimal mode using ALT ENTER then you might find that the gamma is reversed.. your game is dark but your desktop is very bright.
I used to get this alot because my game used to start in minimised mode (intentionally) but full screen in options is set to 1. When I pressed ALT ENTER it would change size but would not goto full screen.
Another effect you might find is your desktop is bright if you unexpededly quit the game. This is because the gamma doesn't revert back to default desktop mode. You can fix this by going to desktop props and search around the tabs for 'color' or 'overlay' then gamma should be there somewhere. You should be able to set it back to default there.
It's a toggle effect because the mimimise mode might not match 'full screen' mode.
It's the same with lightmap/vertex. Never change these using the command or you can end up in a right mess
These are two settings and one has to be on and the other has to be off. If you change them so they are both the same then this can affect the menu options. You can end up with a completely messed up screen changing to vertex and/or lightmap