Display and control your Android device
Use "always on top" only for SDL >= 2.0.5
Romain Vimont1c1fe5ec5317
diff --git a/app/src/compat.h b/app/src/compat.hindex 4f709af6..fd68d61a 100644--- a/app/src/compat.h+++ b/app/src/compat.h@@ -39,6 +39,8 @@# define SCRCPY_SDL_HAS_HINT_MOUSE_FOCUS_CLICKTHROUGH// <https://wiki.libsdl.org/SDL_GetDisplayUsableBounds># define SCRCPY_SDL_HAS_GET_DISPLAY_USABLE_BOUNDS+// <https://wiki.libsdl.org/SDL_WindowFlags>+# define SCRCPY_SDL_HAS_WINDOW_ALWAYS_ON_TOP#endif#endifdiff --git a/app/src/screen.c b/app/src/screen.cindex 4e9752c2..1632e27f 100644--- a/app/src/screen.c+++ b/app/src/screen.c@@ -157,7 +157,12 @@ SDL_bool screen_init_rendering(struct screen *screen,window_flags |= SDL_WINDOW_ALLOW_HIGHDPI;#endifif (always_on_top) {+#ifdef SCRCPY_SDL_HAS_WINDOW_ALWAYS_ON_TOPwindow_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,