Use "always on top" only for SDL >= 2.0.5
The flag SDL_WINDOW_ALWAYS_ON_TOP is available since SDL 2.0.5. Do not use it if SDL is older, to fix compilation failure. Fixes <https://github.com/Genymobile/scrcpy/issues/432>
This commit is contained in:
parent
751600a7f9
commit
1c1fe5ec53
2 changed files with 7 additions and 0 deletions
|
@ -39,6 +39,8 @@
|
||||||
# define SCRCPY_SDL_HAS_HINT_MOUSE_FOCUS_CLICKTHROUGH
|
# define SCRCPY_SDL_HAS_HINT_MOUSE_FOCUS_CLICKTHROUGH
|
||||||
// <https://wiki.libsdl.org/SDL_GetDisplayUsableBounds>
|
// <https://wiki.libsdl.org/SDL_GetDisplayUsableBounds>
|
||||||
# define SCRCPY_SDL_HAS_GET_DISPLAY_USABLE_BOUNDS
|
# define SCRCPY_SDL_HAS_GET_DISPLAY_USABLE_BOUNDS
|
||||||
|
// <https://wiki.libsdl.org/SDL_WindowFlags>
|
||||||
|
# define SCRCPY_SDL_HAS_WINDOW_ALWAYS_ON_TOP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -157,7 +157,12 @@ SDL_bool screen_init_rendering(struct screen *screen,
|
||||||
window_flags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
window_flags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
||||||
#endif
|
#endif
|
||||||
if (always_on_top) {
|
if (always_on_top) {
|
||||||
|
#ifdef SCRCPY_SDL_HAS_WINDOW_ALWAYS_ON_TOP
|
||||||
window_flags |= SDL_WINDOW_ALWAYS_ON_TOP;
|
window_flags |= SDL_WINDOW_ALWAYS_ON_TOP;
|
||||||
|
#else
|
||||||
|
LOGW("The 'always on top' flag is not available "
|
||||||
|
"(compile with SDL >= 2.0.5 to enable it)");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
screen->window = SDL_CreateWindow(device_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
|
screen->window = SDL_CreateWindow(device_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
|
||||||
|
|
Loading…
Reference in a new issue