diff --git a/FAQ.md b/FAQ.md index 4447dfec..09279a6c 100644 --- a/FAQ.md +++ b/FAQ.md @@ -79,3 +79,12 @@ meson x --buildtype release -Dhidpi_support=false ``` However, the video will be displayed at lower resolution. + + +### KWin compositor crashes + +On Plasma Desktop, compositor is disabled while _scrcpy_ is running. + +As a workaround, [disable "Block compositing"][kwin]. + +[kwin]: https://github.com/Genymobile/scrcpy/issues/114#issuecomment-378778613 diff --git a/Makefile b/Makefile index 523dccbd..79439f3d 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ # # "make release-portable" builds a zip containing the client and the server. # +# On Windows with MSYS2/mingw64, execute: +# GRADLE="$PWD/gradlew" mingw32-make release-portable +# # This is a simple Makefile because Meson is not flexible enough to execute some # arbitrary commands. diff --git a/README.md b/README.md index f4908c6d..be71a75e 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,20 @@ pacman -S mingw-w64-x86_64-make \ mingw-w64-x86_64-meson ``` +For a 32 bits version, replace `x86_64` by `i686`: + +```bash +# runtime dependencies +pacman -S mingw-w64-i686-SDL2 \ + mingw-w64-i686-ffmpeg + +# client build dependencies +pacman -S mingw-w64-i686-make \ + mingw-w64-i686-gcc \ + mingw-w64-i686-pkg-config \ + mingw-w64-i686-meson +``` + Java (>= 7) is not available in MSYS2, so if you plan to build the server, install it manually and make it available from the `PATH`: @@ -116,10 +130,17 @@ export PATH="$JAVA_HOME/bin:$PATH" #### Mac OS -Use [Homebrew] to install the packages: +The application is available in [Homebrew]. Just install it: [Homebrew]: https://brew.sh/ +```bash +brew install scrcpy +``` + +Instead, you may want to build it manually. Install the packages: + + ```bash # runtime dependencies brew install sdl2 ffmpeg diff --git a/app/src/convert.c b/app/src/convert.c index d5e75195..9d947cb3 100644 --- a/app/src/convert.c +++ b/app/src/convert.c @@ -73,6 +73,7 @@ static enum android_metastate convert_meta_state(SDL_Keymod mod) { static SDL_bool convert_keycode(SDL_Keycode from, enum android_keycode *to) { switch (from) { MAP(SDLK_RETURN, AKEYCODE_ENTER); + MAP(SDLK_KP_ENTER, AKEYCODE_NUMPAD_ENTER); MAP(SDLK_ESCAPE, AKEYCODE_ESCAPE); MAP(SDLK_BACKSPACE, AKEYCODE_DEL); MAP(SDLK_TAB, AKEYCODE_TAB); diff --git a/app/src/net.c b/app/src/net.c index 1d68f068..83aa7035 100644 --- a/app/src/net.c +++ b/app/src/net.c @@ -82,11 +82,11 @@ ssize_t net_recv_all(socket_t socket, void *buf, size_t len) { return recv(socket, buf, len, MSG_WAITALL); } -ssize_t net_send(socket_t socket, void *buf, size_t len) { +ssize_t net_send(socket_t socket, const void *buf, size_t len) { return send(socket, buf, len, 0); } -ssize_t net_send_all(socket_t socket, void *buf, size_t len) { +ssize_t net_send_all(socket_t socket, const void *buf, size_t len) { ssize_t w; while (len > 0) { w = send(socket, buf, len, 0); @@ -94,7 +94,7 @@ ssize_t net_send_all(socket_t socket, void *buf, size_t len) { return -1; } len -= w; - buf += w; + buf = (char *) buf + w; } return w; } diff --git a/app/src/net.h b/app/src/net.h index d9a9269a..1be1e815 100644 --- a/app/src/net.h +++ b/app/src/net.h @@ -26,8 +26,8 @@ socket_t net_accept(socket_t server_socket); // the _all versions wait/retry until len bytes have been written/read ssize_t net_recv(socket_t socket, void *buf, size_t len); ssize_t net_recv_all(socket_t socket, void *buf, size_t len); -ssize_t net_send(socket_t socket, void *buf, size_t len); -ssize_t net_send_all(socket_t socket, void *buf, size_t len); +ssize_t net_send(socket_t socket, const void *buf, size_t len); +ssize_t net_send_all(socket_t socket, const void *buf, size_t len); // how is SHUT_RD (read), SHUT_WR (write) or SHUT_RDWR (both) SDL_bool net_shutdown(socket_t socket, int how); SDL_bool net_close(socket_t socket); diff --git a/server/src/test/java/com/genymobile/scrcpy/ControlEventReaderTest.java b/server/src/test/java/com/genymobile/scrcpy/ControlEventReaderTest.java index d2b10ccb..3e97096f 100644 --- a/server/src/test/java/com/genymobile/scrcpy/ControlEventReaderTest.java +++ b/server/src/test/java/com/genymobile/scrcpy/ControlEventReaderTest.java @@ -3,6 +3,9 @@ package com.genymobile.scrcpy; import android.view.KeyEvent; import android.view.MotionEvent; +import org.junit.Assert; +import org.junit.Test; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; @@ -10,8 +13,6 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Arrays; -import org.junit.Assert; -import org.junit.Test; public class ControlEventReaderTest {