Browse Source

Platform: don't disable compositing in Sdl2App.

Yay, it was fixed in the meantime!
pull/289/head
Vladimír Vondruš 8 years ago
parent
commit
3828e6b9a3
  1. 3
      doc/changelog.dox
  2. 4
      src/Magnum/Platform/Sdl2Application.cpp
  3. 15
      src/Magnum/Platform/Sdl2Application.h

3
doc/changelog.dox

@ -267,6 +267,9 @@ See also:
@cpp {640, 480} @ce
- @ref Platform::Sdl2Application::Configuration::WindowFlags values that make
no sense on Emscripten are not available there anymore
- When using SDL 2.0.8 and newer, @ref Platform::Sdl2Application no longer
attempts to disable compositing on Linux. See @ref Platform-Sdl2Application-usage-linux
for more information.
@subsubsection changelog-latest-changes-shaders Shaders library

4
src/Magnum/Platform/Sdl2Application.cpp

@ -95,6 +95,10 @@ Sdl2Application::Sdl2Application(const Arguments& arguments, NoCreateT):
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 */
if(args.value("log") == "verbose") _verboseLog = true;
const std::string dpiScaling = args.value("dpi-scaling");

15
src/Magnum/Platform/Sdl2Application.h

@ -228,6 +228,21 @@ If no other application header is included, this class is also aliased to
@cpp Platform::Application @ce and the macro is aliased to @cpp MAGNUM_APPLICATION_MAIN() @ce
to simplify porting.
@subsection Platform-Sdl2Application-usage-linux Linux specifics
SDL by default attempts to disable compositing, which may cause ugly flickering
for non-fullscreen apps (KWin, among others, is known to respect this setting).
When using SDL >= 2.0.8, @ref Sdl2Application turns this behavior off, keeping
the compositor running to avoid the flicker. You can turn this behavior back on
by enabling the [corresponding SDL hint](https://wiki.libsdl.org/CategoryHints) through an environment variable:
@code{.sh}
SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR=1 ./your-app
@endcode
If you're running an older version of SDL, you can disallow apps from bypassing
the compositor in system-wide KWin settings.
@subsection Platform-Sdl2Application-usage-ios iOS specifics
Leaving a default (zero) window size in @ref Configuration will cause the app

Loading…
Cancel
Save