if (ec->xkb_info.keymap != NULL)
return;
- if (ec->xkb_names.rules == NULL)
- weston_compositor_xkb_init(ec, NULL);
-
ec->xkb_info.keymap = xkb_map_new_from_names(ec->xkb_context,
&ec->xkb_names,
0);
{
struct wl_event_loop *loop;
const char *extensions;
+ struct xkb_rule_names xkb_names;
+ const struct config_key keyboard_config_keys[] = {
+ { "keymap_rules", CONFIG_KEY_STRING, &xkb_names.rules },
+ { "keymap_model", CONFIG_KEY_STRING, &xkb_names.model },
+ { "keymap_layout", CONFIG_KEY_STRING, &xkb_names.layout },
+ { "keymap_variant", CONFIG_KEY_STRING, &xkb_names.variant },
+ { "keymap_options", CONFIG_KEY_STRING, &xkb_names.options },
+ };
+ const struct config_section cs[] = {
+ { "keyboard",
+ keyboard_config_keys, ARRAY_LENGTH(keyboard_config_keys) },
+ };
+
+ memset(&xkb_names, 0, sizeof(xkb_names));
+ parse_config_file(config_file, cs, ARRAY_LENGTH(cs), ec);
ec->wl_display = display;
wl_signal_init(&ec->destroy_signal);
vertex_shader, solid_fragment_shader) < 0)
return -1;
+ weston_compositor_xkb_init(ec, &xkb_names);
+
loop = wl_display_get_event_loop(ec->wl_display);
ec->idle_source = wl_event_loop_add_timer(loop, idle_handler, ec);
wl_event_source_timer_update(ec->idle_source, ec->idle_time * 1000);
int32_t xserver = 0;
char *socket_name = NULL;
char *config_file;
- struct xkb_rule_names xkb_names;
const struct config_key shell_config_keys[] = {
{ "type", CONFIG_KEY_STRING, &shell },
};
- const struct config_key keyboard_config_keys[] = {
- { "keymap_rules", CONFIG_KEY_STRING, &xkb_names.rules },
- { "keymap_model", CONFIG_KEY_STRING, &xkb_names.model },
- { "keymap_layout", CONFIG_KEY_STRING, &xkb_names.layout },
- { "keymap_variant", CONFIG_KEY_STRING, &xkb_names.variant },
- { "keymap_options", CONFIG_KEY_STRING, &xkb_names.options },
- };
-
const struct config_section cs[] = {
{ "shell",
shell_config_keys, ARRAY_LENGTH(shell_config_keys) },
- { "keyboard",
- keyboard_config_keys, ARRAY_LENGTH(keyboard_config_keys) },
};
const struct weston_option core_options[] = {
{ WESTON_OPTION_STRING, "module", 0, &module },
};
- memset(&xkb_names, 0, sizeof(xkb_names));
-
argc = parse_options(core_options,
ARRAY_LENGTH(core_options), argc, argv);