aboutsummaryrefslogtreecommitdiff
path: root/rootston/cursor.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-26 17:27:21 -0400
committerGitHub <noreply@github.com>2017-10-26 17:27:21 -0400
commit8fb948c109ca5c9b636bf04d248e5bedd3c7eee3 (patch)
tree7ed1c3e7d7a2a474311e5f0ec96ae26492e480ab /rootston/cursor.c
parent92b41bb51ff1de631767f414a6595585ae1138a9 (diff)
parent882bda066402b19ac4d8b7470d7fbc63347733e7 (diff)
Merge pull request #341 from emersion/per-keyboard-config
Per-keyboard configuration
Diffstat (limited to 'rootston/cursor.c')
-rw-r--r--rootston/cursor.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c
index b55eab3f..7d2548eb 100644
--- a/rootston/cursor.c
+++ b/rootston/cursor.c
@@ -215,8 +215,16 @@ static void handle_cursor_axis(struct wl_listener *listener, void *data) {
event->orientation, event->delta);
}
-static bool is_meta_pressed(struct roots_input *input) {
- uint32_t meta_key = input->server->config->keyboard.meta_key;
+static bool is_meta_pressed(struct roots_input *input,
+ struct wlr_input_device *device) {
+ uint32_t meta_key = 0;
+ 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) {
return false;
}
@@ -241,7 +249,7 @@ static void do_cursor_button_press(struct roots_input *input,
struct roots_view *view = view_at(desktop,
input->cursor->x, input->cursor->y, &surface, &sx, &sy);
- if (state == WLR_BUTTON_PRESSED && view && is_meta_pressed(input)) {
+ if (state == WLR_BUTTON_PRESSED && view && is_meta_pressed(input, device)) {
set_view_focus(input, desktop, view);
switch (button) {