Accept negative window position

It seems to work on some window managers.

Fixes #1242 <https://github.com/Genymobile/scrcpy/issues/1242>
This commit is contained in:
Romain Vimont
2020-03-26 17:54:06 +01:00
parent 3504c0016b
commit dc7c677728
5 changed files with 25 additions and 11 deletions

View File

@@ -186,8 +186,10 @@ screen_init_rendering(struct screen *screen, const char *window_title,
window_flags |= SDL_WINDOW_BORDERLESS;
}
int x = window_x != -1 ? window_x : (int) SDL_WINDOWPOS_UNDEFINED;
int y = window_y != -1 ? window_y : (int) SDL_WINDOWPOS_UNDEFINED;
int x = window_x != WINDOW_POSITION_UNDEFINED
? window_x : (int) SDL_WINDOWPOS_UNDEFINED;
int y = window_y != WINDOW_POSITION_UNDEFINED
? window_y : (int) SDL_WINDOWPOS_UNDEFINED;
screen->window = SDL_CreateWindow(window_title, x, y,
window_size.width, window_size.height,
window_flags);