Skip to content

Display and control your Android device

Use a new scrcpy icon

Romain Vimont6004f0b6b069
diff --git a/app/meson.build b/app/meson.build
index 698120a5..b842bd04 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -151,6 +151,9 @@ executable('scrcpy', src,
c_args: [])
install_man('scrcpy.1')
+install_data('../data/icon.png',
+ rename: 'scrcpy.png',
+ install_dir: 'share/icons/hicolor/256x256/apps')
### TESTS
diff --git a/app/src/screen.c b/app/src/screen.c
index 3cd4329f..8a2748a9 100644
--- a/app/src/screen.c
+++ b/app/src/screen.c
@@ -5,9 +5,8 @@
#include <SDL2/SDL.h>
#include "events.h"
-#include "icon.xpm"
+#include "icon.h"
#include "scrcpy.h"
-#include "tiny_xpm.h"
#include "video_buffer.h"
#include "util/log.h"
@@ -405,10 +404,10 @@ screen_init(struct screen *screen, const struct screen_params *params) {
LOGD("Trilinear filtering disabled (not an OpenGL renderer)");
}
- SDL_Surface *icon = read_xpm(icon_xpm);
+ SDL_Surface *icon = scrcpy_icon_load();
if (icon) {
SDL_SetWindowIcon(screen->window, icon);
- SDL_FreeSurface(icon);
+ scrcpy_icon_destroy(icon);
} else {
LOGW("Could not load icon");
}
diff --git a/data/icon.png b/data/icon.png
new file mode 100644
index 00000000..b96a1aff
Binary files /dev/null and b/data/icon.png differ
diff --git a/release.mk b/release.mk
index e327654c..05ddbe46 100644
--- a/release.mk
+++ b/release.mk
@@ -94,6 +94,7 @@ dist-win32: build-server build-win32
cp "$(WIN32_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN32_TARGET_DIR)/"
cp data/scrcpy-console.bat "$(DIST)/$(WIN32_TARGET_DIR)"
cp data/scrcpy-noconsole.vbs "$(DIST)/$(WIN32_TARGET_DIR)"
+ cp data/icon.png "$(DIST)/$(WIN32_TARGET_DIR)"
cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avutil-56.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avcodec-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avformat-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
@@ -110,6 +111,7 @@ dist-win64: build-server build-win64
cp "$(WIN64_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN64_TARGET_DIR)/"
cp data/scrcpy-console.bat "$(DIST)/$(WIN64_TARGET_DIR)"
cp data/scrcpy-noconsole.vbs "$(DIST)/$(WIN64_TARGET_DIR)"
+ cp data/icon.png "$(DIST)/$(WIN64_TARGET_DIR)"
cp prebuilt-deps/ffmpeg-4.3.1-win64-shared/bin/avutil-56.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
cp prebuilt-deps/ffmpeg-4.3.1-win64-shared/bin/avcodec-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
cp prebuilt-deps/ffmpeg-4.3.1-win64-shared/bin/avformat-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
diff --git a/run b/run
index 628c5c7e..fda3ea57 100755
--- a/run
+++ b/run
@@ -20,4 +20,6 @@ then
exit 1
fi
-SCRCPY_SERVER_PATH="$BUILDDIR/server/scrcpy-server" "$BUILDDIR/app/scrcpy" "$@"
+SCRCPY_ICON_PATH="data/icon.png" \
+SCRCPY_SERVER_PATH="$BUILDDIR/server/scrcpy-server" \
+"$BUILDDIR/app/scrcpy" "$@"