Fix fallback when there are two config blocks for a keyboard

This commit is contained in:
emersion 2017-10-26 22:38:03 +02:00
parent 4e5d23daa9
commit c0c4816b13
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 49 additions and 33 deletions

View file

@ -217,10 +217,12 @@ static void handle_cursor_axis(struct wl_listener *listener, void *data) {
static bool is_meta_pressed(struct roots_input *input,
struct wlr_input_device *device) {
struct keyboard_config *config = config_get_keyboard(input->server->config,
device);
uint32_t meta_key = 0;
if (config != NULL) {
struct keyboard_config *config;
if ((config = config_get_keyboard(input->server->config, device))) {
meta_key = config->meta_key;
} else if (!meta_key && (config = config_get_keyboard(input->server->config,
NULL))) {
meta_key = config->meta_key;
}
if (meta_key == 0) {