eternalcodes / EternalJK

Effort to maintain and improve OpenJK
GNU General Public License v2.0
60 stars 23 forks source link

Minimize by Alt-Tab or Windows Key doesn't work in fullscreen but /minimize command works fine #114

Open Nightshades1 opened 3 years ago

Nightshades1 commented 3 years ago

Reporting a bug? Please make sure you've given the following information in detail - thanks!

Operating system and version: Windows 8.1

Description of the bug (and if possible, steps to reproduce the bug): Hello, Took current source and built addition on top of it with some changes, Alt-Tab or Windows Key doesn't work in fullscreen

What did you expect to happen instead? I expect it to minimize the game

Edit: I upgraded all windows libs to their latest version (sdl2 as well) could it be sdl2 issue ?

Nightshades1 commented 2 years ago

Update: This is indeed an issue with SDL2 i tried with SDL2 2.0.14 Compiled with an old SDL2 DLL (2.0.3) and it work as intended, something fucked up with latest SDL2 🤔

Nightshades1 commented 2 years ago

Okay To fix the issue you have to add SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1"); just before SDL_Init inside GLimp_StartDriverAndSetMode function

In recent SDL2 version the devs made SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS to be "0" By default, that's what prevented the game to be minimized with alt+tab i hope it help you, got it to work perfect using latest SDL2 version, no more issue 👍