Commit 68d16dfa authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

input method: spawn at startup

parent 34db041b
Pipeline #884 passed with stage
in 3 minutes and 1 second
......@@ -77,6 +77,7 @@ struct roots_config {
char *config_path;
char *startup_cmd;
char *im_cmd;
bool debug_damage_tracking;
};
......
......@@ -273,6 +273,15 @@ static void config_handle_keyboard(struct roots_config *config,
}
}
static void config_handle_input_method(struct roots_config *config,
const char *name, const char *value) {
if (strcmp(name, "executable") == 0) {
config->im_cmd = strdup(value);
} else {
wlr_log(WLR_ERROR, "got unknown input method config: %s", name);
}
}
static const char *output_prefix = "output:";
static const char *device_prefix = "device:";
static const char *keyboard_prefix = "keyboard:";
......@@ -433,6 +442,8 @@ static int config_ini_handler(void *user, const char *section, const char *name,
config_handle_keyboard(config, device_name, name, value);
} else if (strcmp(section, "bindings") == 0) {
add_binding_config(&config->bindings, name, value);
} else if (strcmp(section, "input-method") == 0) {
config_handle_input_method(config, name, value);
} else {
wlr_log(WLR_ERROR, "got unknown config section: %s", section);
}
......
......@@ -72,7 +72,25 @@ int main(int argc, char **argv) {
}
}
if (subprocess_init(server.wl_event_loop)) {
wlr_log(WLR_ERROR, "Cannot initialize child process manager");
wlr_backend_destroy(server.backend);
wl_display_destroy(server.wl_display);
return 1;
}
if (server.config->im_cmd != NULL) {
int ret = subprocess_start_respawning(server.config->im_cmd, false);
if (ret) {
wlr_log(WLR_ERROR, "Cannot launch input method command");
subprocess_uninit();
wlr_backend_destroy(server.backend);
wl_display_destroy(server.wl_display);
return 1;
}
}
wl_display_run(server.wl_display);
subprocess_uninit();
#ifdef WLR_HAS_XWAYLAND
wlr_xwayland_destroy(server.desktop->xwayland);
#endif
......
......@@ -59,3 +59,6 @@ Logo+q = close
Logo+m = maximize
Alt+Tab = next_window
Ctrl+Shift+a = alpha
[input-method]
executable = /usr/bin/virtboard
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment