From d634995e7938bbafaf5dd51e646d198cb1a1ff4e Mon Sep 17 00:00:00 2001 From: Frank Leon Rose Date: Mon, 12 Apr 2021 16:18:36 -0400 Subject: [PATCH 1/2] Fix response to --window-borderless setting --- app/src/screen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/screen.c b/app/src/screen.c index fe2bc867..23473455 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -283,6 +283,13 @@ screen_init_rendering(struct screen *screen, const char *window_title, const char *renderer_name = r ? NULL : renderer_info.name; LOGI("Renderer: %s", renderer_name ? renderer_name : "(unknown)"); + // NOTE(frankleonrose): Despite setting flags on window construction, + // version 1.17 of scrcpy on macOS was showing the title bar when + // --window-borderless flag was used. Explicitly setting border + // property here solved the problem. + LOGI("Borderless: %s", window_borderless ? "Yes" : "No"); + SDL_SetWindowBordered(screen->window, !window_borderless); + // starts with "opengl" screen->use_opengl = renderer_name && !strncmp(renderer_name, "opengl", 6); if (screen->use_opengl) { From 403c4e75badd65a5333084a3739d9d53212682fd Mon Sep 17 00:00:00 2001 From: Frank Leon Rose Date: Mon, 12 Apr 2021 17:51:32 -0400 Subject: [PATCH 2/2] Fix macOS build --- mobot.mk | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mobot.mk b/mobot.mk index f3072178..accc4b8b 100644 --- a/mobot.mk +++ b/mobot.mk @@ -7,6 +7,9 @@ # sudo snap install scrcpy (for server .jar) # On Raspberry Pi it may be necessary to install # sudo apt-get install ninja-build meson libudev1 libsdl2-dev +# On macOS, if for some reason you have libiconv via Mac Ports, deactivate it +# before building +# sudo port deactivate libiconv .DEFAULT_GOAL := scrcpy @@ -14,12 +17,22 @@ AVDIR:=build-libav AVLIBDIR:=$(AVDIR)/lib AVLIBS:=$(AVLIBDIR)/libavformat.a $(AVLIBDIR)/libavcodec.a $(AVLIBDIR)/libavutil.a $(AVLIBDIR)/libswscale.a +OS := $(shell uname -s) +ifeq ($(OS),Darwin) + MAC_LDFLAGS := -Wl,-framework -Wl,CoreVideo \ + -Wl,-framework -Wl,CoreMedia \ + -Wl,-framework -Wl,Foundation \ + -Wl,-framework -Wl,VideoToolbox \ + -Wl,-liconv +endif + build-ffmpeg: git clone https://github.com/team-mobot/FFmpeg.git build-ffmpeg $(AVLIBS): build-ffmpeg # Build Mobot version of FFmpeg and install in subdir libav cd build-ffmpeg && \ + git pull && \ git checkout release/4.3 && \ ./configure --prefix="../build-libav" \ --pkg-config-flags="--static" \ @@ -36,7 +49,7 @@ $(AVLIBS): build-ffmpeg make install-libs install-headers build-app: $(AVLIBS) - LDFLAGS="-Wl,-lm -Wl,-lpthread" \ + LDFLAGS="-Wl,-lm -Wl,-lpthread $(MAC_LDFLAGS)" \ meson build-app --buildtype release --strip -Db_lto=true \ -Dlocal_libav=$(AVDIR) \ -Dcompile_server=false \