Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To fix windows build issue and Run adb kill-server when exit. #1852

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${default}"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "C:/msys64/mingw64/bin/cc.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
"compileCommands": "${workspaceFolder}/x/compile_commands.json"
}
],
"version": 4
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"files.associations": {
"*.tcc": "c",
"random": "c",
"ostream": "c",
"streambuf": "c"
}
}
2 changes: 2 additions & 0 deletions app/src/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ screen_init_rendering(struct screen *screen, const char *window_title,
window_flags |= SDL_WINDOW_BORDERLESS;
}

SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");

int x = window_x != SC_WINDOW_POSITION_UNDEFINED
? window_x : (int) SDL_WINDOWPOS_UNDEFINED;
int y = window_y != SC_WINDOW_POSITION_UNDEFINED
Expand Down
6 changes: 6 additions & 0 deletions app/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,11 @@ server_stop(struct server *server) {

void
server_destroy(struct server *server) {
const char *const cmd[] = {
"kill-server",
};

adb_execute(server->serial, cmd, sizeof(cmd) / sizeof(cmd[0]));

SDL_free(server->serial);
}
2 changes: 1 addition & 1 deletion server/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if prebuilt_server == ''
build_by_default: true,
build_always_stale: true,
output: 'scrcpy-server',
command: [find_program('./scripts/build-wrapper.sh'), meson.current_source_dir(), '@OUTPUT@', get_option('buildtype')],
command: ['sh', '../server/scripts/build-wrapper.sh', meson.current_source_dir(), '@OUTPUT@', get_option('buildtype')],
console: true,
install: true,
install_dir: 'share/scrcpy')
Expand Down