Browse Source

Fix #4251 macOS mouse grab issue (#4298)

pull/3938/head
Bubio 4 years ago committed by GitHub
parent
commit
57d5fd0e62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      Source/utils/display.cpp

11
Source/utils/display.cpp

@ -243,11 +243,14 @@ bool SpawnWindow(const char *lpWindowName)
flags |= SDL_WINDOW_FULLSCREEN;
}
if (*sgOptions.Gameplay.grabInput) {
flags |= SDL_WINDOW_INPUT_GRABBED;
}
ghMainWnd = SDL_CreateWindow(lpWindowName, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, windowSize.width, windowSize.height, flags);
// Note: https://github.com/libsdl-org/SDL/issues/962
// This is a solution to a problem related to SDL mouse grab.
// See https://github.com/diasurgical/devilutionX/issues/4251
if (ghMainWnd != nullptr)
SDL_SetWindowGrab(ghMainWnd, *sgOptions.Gameplay.grabInput ? SDL_TRUE : SDL_FALSE);
#endif
if (ghMainWnd == nullptr) {
ErrSdl();

Loading…
Cancel
Save