Browse Source

Platform: set SDL hints before SDL_Init().

Some of them need that.
simd
Vladimír Vondruš 7 years ago
parent
commit
40c0576918
  1. 10
      src/Magnum/Platform/Sdl2Application.cpp

10
src/Magnum/Platform/Sdl2Application.cpp

@ -91,15 +91,17 @@ Sdl2Application::Sdl2Application(const Arguments& arguments, NoCreateT):
args.parse(arguments.argc, arguments.argv); args.parse(arguments.argc, arguments.argv);
#endif #endif
/* Available since 2.0.8, disables compositor bypass on X11, which causes
flickering on KWin as the compositor gets shut down on every startup */
#ifdef SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR
SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0");
#endif
if(SDL_Init(SDL_INIT_VIDEO) < 0) { if(SDL_Init(SDL_INIT_VIDEO) < 0) {
Error() << "Cannot initialize SDL."; Error() << "Cannot initialize SDL.";
std::exit(1); std::exit(1);
} }
#ifdef SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR /* Available since 2.0.8 */
SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0");
#endif
/* Save command-line arguments */ /* Save command-line arguments */
if(args.value("log") == "verbose") _verboseLog = true; if(args.value("log") == "verbose") _verboseLog = true;
const std::string dpiScaling = args.value("dpi-scaling"); const std::string dpiScaling = args.value("dpi-scaling");

Loading…
Cancel
Save