aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-20 13:51:12 -0500
committerLibravatar emersion <contact@emersion.fr>2019-01-21 12:59:42 +0100
commit1211a81aad18bbc4d9e8fb9973238ad8e7e1f688 (patch)
tree5c3f60e0219cb8b4a1b7cafb760a871661866e32 /sway/input/keyboard.c
parentLog libinput_config_status errors (diff)
downloadsway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.gz
sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.tar.zst
sway-1211a81aad18bbc4d9e8fb9973238ad8e7e1f688.zip
Replace wlr_log with sway_log
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 2ea796a9..c1fc60f7 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -126,7 +126,7 @@ static void get_active_binding(const struct sway_shortcut_state *state,
126 126
127 if (*current_binding && *current_binding != binding && 127 if (*current_binding && *current_binding != binding &&
128 strcmp((*current_binding)->input, binding->input) == 0) { 128 strcmp((*current_binding)->input, binding->input) == 0) {
129 wlr_log(WLR_DEBUG, "encountered duplicate bindings %d and %d", 129 sway_log(SWAY_DEBUG, "encountered duplicate bindings %d and %d",
130 (*current_binding)->order, binding->order); 130 (*current_binding)->order, binding->order);
131 } else if (!*current_binding || 131 } else if (!*current_binding ||
132 strcmp((*current_binding)->input, "*") == 0) { 132 strcmp((*current_binding)->input, "*") == 0) {
@@ -219,7 +219,7 @@ void sway_keyboard_disarm_key_repeat(struct sway_keyboard *keyboard) {
219 } 219 }
220 keyboard->repeat_binding = NULL; 220 keyboard->repeat_binding = NULL;
221 if (wl_event_source_timer_update(keyboard->key_repeat_source, 0) < 0) { 221 if (wl_event_source_timer_update(keyboard->key_repeat_source, 0) < 0) {
222 wlr_log(WLR_DEBUG, "failed to disarm key repeat timer"); 222 sway_log(SWAY_DEBUG, "failed to disarm key repeat timer");
223 } 223 }
224} 224}
225 225
@@ -313,7 +313,7 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) {
313 keyboard->repeat_binding = binding; 313 keyboard->repeat_binding = binding;
314 if (wl_event_source_timer_update(keyboard->key_repeat_source, 314 if (wl_event_source_timer_update(keyboard->key_repeat_source,
315 wlr_device->keyboard->repeat_info.delay) < 0) { 315 wlr_device->keyboard->repeat_info.delay) < 0) {
316 wlr_log(WLR_DEBUG, "failed to set key repeat timer"); 316 sway_log(SWAY_DEBUG, "failed to set key repeat timer");
317 } 317 }
318 } else if (keyboard->repeat_binding) { 318 } else if (keyboard->repeat_binding) {
319 sway_keyboard_disarm_key_repeat(keyboard); 319 sway_keyboard_disarm_key_repeat(keyboard);
@@ -356,7 +356,7 @@ static int handle_keyboard_repeat(void *data) {
356 // We queue the next event first, as the command might cancel it 356 // We queue the next event first, as the command might cancel it
357 if (wl_event_source_timer_update(keyboard->key_repeat_source, 357 if (wl_event_source_timer_update(keyboard->key_repeat_source,
358 1000 / wlr_device->repeat_info.rate) < 0) { 358 1000 / wlr_device->repeat_info.rate) < 0) {
359 wlr_log(WLR_DEBUG, "failed to update key repeat timer"); 359 sway_log(SWAY_DEBUG, "failed to update key repeat timer");
360 } 360 }
361 } 361 }
362 362
@@ -460,7 +460,7 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) {
460 xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); 460 xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS);
461 461
462 if (!keymap) { 462 if (!keymap) {
463 wlr_log(WLR_DEBUG, "cannot configure keyboard: keymap does not exist"); 463 sway_log(SWAY_DEBUG, "cannot configure keyboard: keymap does not exist");
464 xkb_context_unref(context); 464 xkb_context_unref(context);
465 return; 465 return;
466 } 466 }