Initialize input manager dynamically

To simulate multitouch, we will need more fields in input_manager, which
will be initialized dynamically.
This commit is contained in:
Romain Vimont
2019-10-06 21:36:06 +02:00
parent 6220456def
commit 9448eae8a4
3 changed files with 19 additions and 6 deletions

View File

@@ -37,12 +37,7 @@ static struct decoder decoder;
static struct recorder recorder;
static struct controller controller;
static struct file_handler file_handler;
static struct input_manager input_manager = {
.controller = &controller,
.video_buffer = &video_buffer,
.screen = &screen,
};
static struct input_manager input_manager;
// init SDL and set appropriate hints
static bool
@@ -311,6 +306,8 @@ scrcpy(const struct scrcpy_options *options) {
goto end;
}
input_manager_init(&input_manager, &controller, &video_buffer, &screen);
if (!server_connect_to(&server)) {
goto end;
}