Merge pull request #4 from team-mobot/ENG-2350-fix-mac-scrcpy

ENG-2350 Fix macOS title bar showing despite --window-borderless
This commit is contained in:
Frank Leon Rose 2021-04-20 15:08:42 -04:00 committed by GitHub
commit e7ee8e38cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

@ -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) {

View file

@ -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 \