aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
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
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')
-rw-r--r--sway/input/cursor.c4
-rw-r--r--sway/input/input-manager.c84
-rw-r--r--sway/input/keyboard.c10
-rw-r--r--sway/input/seat.c32
4 files changed, 65 insertions, 65 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 35683f06..bf9bf2da 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -713,7 +713,7 @@ static uint32_t wl_axis_to_button(struct wlr_event_pointer_axis *event) {
713 case WLR_AXIS_ORIENTATION_HORIZONTAL: 713 case WLR_AXIS_ORIENTATION_HORIZONTAL:
714 return event->delta < 0 ? SWAY_SCROLL_LEFT : SWAY_SCROLL_RIGHT; 714 return event->delta < 0 ? SWAY_SCROLL_LEFT : SWAY_SCROLL_RIGHT;
715 default: 715 default:
716 wlr_log(WLR_DEBUG, "Unknown axis orientation"); 716 sway_log(SWAY_DEBUG, "Unknown axis orientation");
717 return 0; 717 return 0;
718 } 718 }
719} 719}
@@ -1004,7 +1004,7 @@ static void handle_request_set_cursor(struct wl_listener *listener,
1004 // TODO: check cursor mode 1004 // TODO: check cursor mode
1005 if (focused_client == NULL || 1005 if (focused_client == NULL ||
1006 event->seat_client->client != focused_client) { 1006 event->seat_client->client != focused_client) {
1007 wlr_log(WLR_DEBUG, "denying request to set cursor from unfocused client"); 1007 sway_log(SWAY_DEBUG, "denying request to set cursor from unfocused client");
1008 return; 1008 return;
1009 } 1009 }
1010 1010
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 9fff5f48..2b4a99d4 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -62,7 +62,7 @@ char *input_device_get_identifier(struct wlr_input_device *device) {
62 int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; 62 int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1;
63 char *identifier = malloc(len); 63 char *identifier = malloc(len);
64 if (!identifier) { 64 if (!identifier) {
65 wlr_log(WLR_ERROR, "Unable to allocate unique input device name"); 65 sway_log(SWAY_ERROR, "Unable to allocate unique input device name");
66 return NULL; 66 return NULL;
67 } 67 }
68 68
@@ -98,7 +98,7 @@ static bool input_has_seat_fallback_configuration(void) {
98void input_manager_verify_fallback_seat(void) { 98void input_manager_verify_fallback_seat(void) {
99 struct sway_seat *seat = NULL; 99 struct sway_seat *seat = NULL;
100 if (!input_has_seat_fallback_configuration()) { 100 if (!input_has_seat_fallback_configuration()) {
101 wlr_log(WLR_DEBUG, "no fallback seat config - creating default"); 101 sway_log(SWAY_DEBUG, "no fallback seat config - creating default");
102 seat = input_manager_get_default_seat(); 102 seat = input_manager_get_default_seat();
103 struct seat_config *sc = new_seat_config(seat->wlr_seat->name); 103 struct seat_config *sc = new_seat_config(seat->wlr_seat->name);
104 sc->fallback = true; 104 sc->fallback = true;
@@ -124,11 +124,11 @@ static void input_manager_libinput_config_keyboard(
124 } 124 }
125 125
126 libinput_device = wlr_libinput_get_device_handle(wlr_device); 126 libinput_device = wlr_libinput_get_device_handle(wlr_device);
127 wlr_log(WLR_DEBUG, "input_manager_libinput_config_keyboard(%s)", 127 sway_log(SWAY_DEBUG, "input_manager_libinput_config_keyboard(%s)",
128 ic->identifier); 128 ic->identifier);
129 129
130 if (ic->send_events != INT_MIN) { 130 if (ic->send_events != INT_MIN) {
131 wlr_log(WLR_DEBUG, "libinput_config_keyboard(%s) send_events_set_mode(%d)", 131 sway_log(SWAY_DEBUG, "libinput_config_keyboard(%s) send_events_set_mode(%d)",
132 ic->identifier, ic->send_events); 132 ic->identifier, ic->send_events);
133 log_libinput_config_status(libinput_device_config_send_events_set_mode( 133 log_libinput_config_status(libinput_device_config_send_events_set_mode(
134 libinput_device, ic->send_events)); 134 libinput_device, ic->send_events));
@@ -148,7 +148,7 @@ static void input_manager_libinput_reset_keyboard(
148 148
149 uint32_t send_events = 149 uint32_t send_events =
150 libinput_device_config_send_events_get_default_mode(libinput_device); 150 libinput_device_config_send_events_get_default_mode(libinput_device);
151 wlr_log(WLR_DEBUG, "libinput_reset_keyboard(%s) send_events_set_mode(%d)", 151 sway_log(SWAY_DEBUG, "libinput_reset_keyboard(%s) send_events_set_mode(%d)",
152 input_device->identifier, send_events); 152 input_device->identifier, send_events);
153 log_libinput_config_status(libinput_device_config_send_events_set_mode( 153 log_libinput_config_status(libinput_device_config_send_events_set_mode(
154 libinput_device, send_events)); 154 libinput_device, send_events));
@@ -165,11 +165,11 @@ static void input_manager_libinput_config_touch(
165 } 165 }
166 166
167 libinput_device = wlr_libinput_get_device_handle(wlr_device); 167 libinput_device = wlr_libinput_get_device_handle(wlr_device);
168 wlr_log(WLR_DEBUG, "input_manager_libinput_config_touch(%s)", 168 sway_log(SWAY_DEBUG, "input_manager_libinput_config_touch(%s)",
169 ic->identifier); 169 ic->identifier);
170 170
171 if (ic->send_events != INT_MIN) { 171 if (ic->send_events != INT_MIN) {
172 wlr_log(WLR_DEBUG, "libinput_config_touch(%s) send_events_set_mode(%d)", 172 sway_log(SWAY_DEBUG, "libinput_config_touch(%s) send_events_set_mode(%d)",
173 ic->identifier, ic->send_events); 173 ic->identifier, ic->send_events);
174 log_libinput_config_status(libinput_device_config_send_events_set_mode( 174 log_libinput_config_status(libinput_device_config_send_events_set_mode(
175 libinput_device, ic->send_events)); 175 libinput_device, ic->send_events));
@@ -189,7 +189,7 @@ static void input_manager_libinput_reset_touch(
189 189
190 uint32_t send_events = 190 uint32_t send_events =
191 libinput_device_config_send_events_get_default_mode(libinput_device); 191 libinput_device_config_send_events_get_default_mode(libinput_device);
192 wlr_log(WLR_DEBUG, "libinput_reset_touch(%s) send_events_set_mode(%d)", 192 sway_log(SWAY_DEBUG, "libinput_reset_touch(%s) send_events_set_mode(%d)",
193 input_device->identifier, send_events); 193 input_device->identifier, send_events);
194 log_libinput_config_status(libinput_device_config_send_events_set_mode( 194 log_libinput_config_status(libinput_device_config_send_events_set_mode(
195 libinput_device, send_events)); 195 libinput_device, send_events));
@@ -206,30 +206,30 @@ static void input_manager_libinput_config_pointer(
206 } 206 }
207 207
208 libinput_device = wlr_libinput_get_device_handle(wlr_device); 208 libinput_device = wlr_libinput_get_device_handle(wlr_device);
209 wlr_log(WLR_DEBUG, "input_manager_libinput_config_pointer(%s)", 209 sway_log(SWAY_DEBUG, "input_manager_libinput_config_pointer(%s)",
210 ic->identifier); 210 ic->identifier);
211 211
212 if (ic->accel_profile != INT_MIN) { 212 if (ic->accel_profile != INT_MIN) {
213 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)", 213 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)",
214 ic->identifier, ic->accel_profile); 214 ic->identifier, ic->accel_profile);
215 log_libinput_config_status(libinput_device_config_accel_set_profile( 215 log_libinput_config_status(libinput_device_config_accel_set_profile(
216 libinput_device, ic->accel_profile)); 216 libinput_device, ic->accel_profile));
217 } 217 }
218 if (ic->click_method != INT_MIN) { 218 if (ic->click_method != INT_MIN) {
219 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)", 219 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)",
220 ic->identifier, ic->click_method); 220 ic->identifier, ic->click_method);
221 log_libinput_config_status(libinput_device_config_click_set_method( 221 log_libinput_config_status(libinput_device_config_click_set_method(
222 libinput_device, ic->click_method)); 222 libinput_device, ic->click_method));
223 } 223 }
224 if (ic->drag != INT_MIN) { 224 if (ic->drag != INT_MIN) {
225 wlr_log(WLR_DEBUG, 225 sway_log(SWAY_DEBUG,
226 "libinput_config_pointer(%s) tap_set_drag_enabled(%d)", 226 "libinput_config_pointer(%s) tap_set_drag_enabled(%d)",
227 ic->identifier, ic->drag); 227 ic->identifier, ic->drag);
228 log_libinput_config_status(libinput_device_config_tap_set_drag_enabled( 228 log_libinput_config_status(libinput_device_config_tap_set_drag_enabled(
229 libinput_device, ic->drag)); 229 libinput_device, ic->drag));
230 } 230 }
231 if (ic->drag_lock != INT_MIN) { 231 if (ic->drag_lock != INT_MIN) {
232 wlr_log(WLR_DEBUG, 232 sway_log(SWAY_DEBUG,
233 "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)", 233 "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)",
234 ic->identifier, ic->drag_lock); 234 ic->identifier, ic->drag_lock);
235 log_libinput_config_status( 235 log_libinput_config_status(
@@ -237,20 +237,20 @@ static void input_manager_libinput_config_pointer(
237 libinput_device, ic->drag_lock)); 237 libinput_device, ic->drag_lock));
238 } 238 }
239 if (ic->dwt != INT_MIN) { 239 if (ic->dwt != INT_MIN) {
240 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)", 240 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)",
241 ic->identifier, ic->dwt); 241 ic->identifier, ic->dwt);
242 log_libinput_config_status(libinput_device_config_dwt_set_enabled( 242 log_libinput_config_status(libinput_device_config_dwt_set_enabled(
243 libinput_device, ic->dwt)); 243 libinput_device, ic->dwt));
244 } 244 }
245 if (ic->left_handed != INT_MIN) { 245 if (ic->left_handed != INT_MIN) {
246 wlr_log(WLR_DEBUG, 246 sway_log(SWAY_DEBUG,
247 "libinput_config_pointer(%s) left_handed_set_enabled(%d)", 247 "libinput_config_pointer(%s) left_handed_set_enabled(%d)",
248 ic->identifier, ic->left_handed); 248 ic->identifier, ic->left_handed);
249 log_libinput_config_status(libinput_device_config_left_handed_set( 249 log_libinput_config_status(libinput_device_config_left_handed_set(
250 libinput_device, ic->left_handed)); 250 libinput_device, ic->left_handed));
251 } 251 }
252 if (ic->middle_emulation != INT_MIN) { 252 if (ic->middle_emulation != INT_MIN) {
253 wlr_log(WLR_DEBUG, 253 sway_log(SWAY_DEBUG,
254 "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)", 254 "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)",
255 ic->identifier, ic->middle_emulation); 255 ic->identifier, ic->middle_emulation);
256 log_libinput_config_status( 256 log_libinput_config_status(
@@ -258,7 +258,7 @@ static void input_manager_libinput_config_pointer(
258 libinput_device, ic->middle_emulation)); 258 libinput_device, ic->middle_emulation));
259 } 259 }
260 if (ic->natural_scroll != INT_MIN) { 260 if (ic->natural_scroll != INT_MIN) {
261 wlr_log(WLR_DEBUG, 261 sway_log(SWAY_DEBUG,
262 "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)", 262 "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)",
263 ic->identifier, ic->natural_scroll); 263 ic->identifier, ic->natural_scroll);
264 log_libinput_config_status( 264 log_libinput_config_status(
@@ -266,37 +266,37 @@ static void input_manager_libinput_config_pointer(
266 libinput_device, ic->natural_scroll)); 266 libinput_device, ic->natural_scroll));
267 } 267 }
268 if (ic->pointer_accel != FLT_MIN) { 268 if (ic->pointer_accel != FLT_MIN) {
269 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)", 269 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)",
270 ic->identifier, ic->pointer_accel); 270 ic->identifier, ic->pointer_accel);
271 log_libinput_config_status(libinput_device_config_accel_set_speed( 271 log_libinput_config_status(libinput_device_config_accel_set_speed(
272 libinput_device, ic->pointer_accel)); 272 libinput_device, ic->pointer_accel));
273 } 273 }
274 if (ic->scroll_button != INT_MIN) { 274 if (ic->scroll_button != INT_MIN) {
275 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) scroll_set_button(%d)", 275 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) scroll_set_button(%d)",
276 ic->identifier, ic->scroll_button); 276 ic->identifier, ic->scroll_button);
277 log_libinput_config_status(libinput_device_config_scroll_set_button( 277 log_libinput_config_status(libinput_device_config_scroll_set_button(
278 libinput_device, ic->scroll_button)); 278 libinput_device, ic->scroll_button));
279 } 279 }
280 if (ic->scroll_method != INT_MIN) { 280 if (ic->scroll_method != INT_MIN) {
281 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)", 281 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)",
282 ic->identifier, ic->scroll_method); 282 ic->identifier, ic->scroll_method);
283 log_libinput_config_status(libinput_device_config_scroll_set_method( 283 log_libinput_config_status(libinput_device_config_scroll_set_method(
284 libinput_device, ic->scroll_method)); 284 libinput_device, ic->scroll_method));
285 } 285 }
286 if (ic->send_events != INT_MIN) { 286 if (ic->send_events != INT_MIN) {
287 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)", 287 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)",
288 ic->identifier, ic->send_events); 288 ic->identifier, ic->send_events);
289 log_libinput_config_status(libinput_device_config_send_events_set_mode( 289 log_libinput_config_status(libinput_device_config_send_events_set_mode(
290 libinput_device, ic->send_events)); 290 libinput_device, ic->send_events));
291 } 291 }
292 if (ic->tap != INT_MIN) { 292 if (ic->tap != INT_MIN) {
293 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)", 293 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)",
294 ic->identifier, ic->tap); 294 ic->identifier, ic->tap);
295 log_libinput_config_status(libinput_device_config_tap_set_enabled( 295 log_libinput_config_status(libinput_device_config_tap_set_enabled(
296 libinput_device, ic->tap)); 296 libinput_device, ic->tap));
297 } 297 }
298 if (ic->tap_button_map != INT_MIN) { 298 if (ic->tap_button_map != INT_MIN) {
299 wlr_log(WLR_DEBUG, "libinput_config_pointer(%s) tap_set_button_map(%d)", 299 sway_log(SWAY_DEBUG, "libinput_config_pointer(%s) tap_set_button_map(%d)",
300 ic->identifier, ic->tap_button_map); 300 ic->identifier, ic->tap_button_map);
301 log_libinput_config_status(libinput_device_config_tap_set_button_map( 301 log_libinput_config_status(libinput_device_config_tap_set_button_map(
302 libinput_device, ic->tap_button_map)); 302 libinput_device, ic->tap_button_map));
@@ -316,21 +316,21 @@ static void input_manager_libinput_reset_pointer(
316 316
317 enum libinput_config_accel_profile accel_profile = 317 enum libinput_config_accel_profile accel_profile =
318 libinput_device_config_accel_get_default_profile(libinput_device); 318 libinput_device_config_accel_get_default_profile(libinput_device);
319 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) accel_set_profile(%d)", 319 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) accel_set_profile(%d)",
320 input_device->identifier, accel_profile); 320 input_device->identifier, accel_profile);
321 log_libinput_config_status(libinput_device_config_accel_set_profile( 321 log_libinput_config_status(libinput_device_config_accel_set_profile(
322 libinput_device, accel_profile)); 322 libinput_device, accel_profile));
323 323
324 enum libinput_config_click_method click_method = 324 enum libinput_config_click_method click_method =
325 libinput_device_config_click_get_default_method(libinput_device); 325 libinput_device_config_click_get_default_method(libinput_device);
326 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) click_set_method(%d)", 326 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) click_set_method(%d)",
327 input_device->identifier, click_method); 327 input_device->identifier, click_method);
328 log_libinput_config_status(libinput_device_config_click_set_method( 328 log_libinput_config_status(libinput_device_config_click_set_method(
329 libinput_device, click_method)); 329 libinput_device, click_method));
330 330
331 enum libinput_config_drag_state drag = 331 enum libinput_config_drag_state drag =
332 libinput_device_config_tap_get_default_drag_enabled(libinput_device); 332 libinput_device_config_tap_get_default_drag_enabled(libinput_device);
333 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_drag_enabled(%d)", 333 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_drag_enabled(%d)",
334 input_device->identifier, drag); 334 input_device->identifier, drag);
335 log_libinput_config_status(libinput_device_config_tap_set_drag_enabled( 335 log_libinput_config_status(libinput_device_config_tap_set_drag_enabled(
336 libinput_device, drag)); 336 libinput_device, drag));
@@ -338,7 +338,7 @@ static void input_manager_libinput_reset_pointer(
338 enum libinput_config_drag_lock_state drag_lock = 338 enum libinput_config_drag_lock_state drag_lock =
339 libinput_device_config_tap_get_default_drag_lock_enabled( 339 libinput_device_config_tap_get_default_drag_lock_enabled(
340 libinput_device); 340 libinput_device);
341 wlr_log(WLR_DEBUG, 341 sway_log(SWAY_DEBUG,
342 "libinput_reset_pointer(%s) tap_set_drag_lock_enabled(%d)", 342 "libinput_reset_pointer(%s) tap_set_drag_lock_enabled(%d)",
343 input_device->identifier, drag_lock); 343 input_device->identifier, drag_lock);
344 log_libinput_config_status( 344 log_libinput_config_status(
@@ -347,14 +347,14 @@ static void input_manager_libinput_reset_pointer(
347 347
348 enum libinput_config_dwt_state dwt = 348 enum libinput_config_dwt_state dwt =
349 libinput_device_config_dwt_get_default_enabled(libinput_device); 349 libinput_device_config_dwt_get_default_enabled(libinput_device);
350 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) dwt_set_enabled(%d)", 350 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) dwt_set_enabled(%d)",
351 input_device->identifier, dwt); 351 input_device->identifier, dwt);
352 log_libinput_config_status(libinput_device_config_dwt_set_enabled( 352 log_libinput_config_status(libinput_device_config_dwt_set_enabled(
353 libinput_device, dwt)); 353 libinput_device, dwt));
354 354
355 int left_handed = 355 int left_handed =
356 libinput_device_config_left_handed_get_default(libinput_device); 356 libinput_device_config_left_handed_get_default(libinput_device);
357 wlr_log(WLR_DEBUG, 357 sway_log(SWAY_DEBUG,
358 "libinput_reset_pointer(%s) left_handed_set_enabled(%d)", 358 "libinput_reset_pointer(%s) left_handed_set_enabled(%d)",
359 input_device->identifier, left_handed); 359 input_device->identifier, left_handed);
360 log_libinput_config_status(libinput_device_config_left_handed_set( 360 log_libinput_config_status(libinput_device_config_left_handed_set(
@@ -363,7 +363,7 @@ static void input_manager_libinput_reset_pointer(
363 enum libinput_config_middle_emulation_state middle_emulation = 363 enum libinput_config_middle_emulation_state middle_emulation =
364 libinput_device_config_middle_emulation_get_default_enabled( 364 libinput_device_config_middle_emulation_get_default_enabled(
365 libinput_device); 365 libinput_device);
366 wlr_log(WLR_DEBUG, 366 sway_log(SWAY_DEBUG,
367 "libinput_reset_pointer(%s) middle_emulation_set_enabled(%d)", 367 "libinput_reset_pointer(%s) middle_emulation_set_enabled(%d)",
368 input_device->identifier, middle_emulation); 368 input_device->identifier, middle_emulation);
369 log_libinput_config_status( 369 log_libinput_config_status(
@@ -373,7 +373,7 @@ static void input_manager_libinput_reset_pointer(
373 int natural_scroll = 373 int natural_scroll =
374 libinput_device_config_scroll_get_default_natural_scroll_enabled( 374 libinput_device_config_scroll_get_default_natural_scroll_enabled(
375 libinput_device); 375 libinput_device);
376 wlr_log(WLR_DEBUG, 376 sway_log(SWAY_DEBUG,
377 "libinput_reset_pointer(%s) natural_scroll_set_enabled(%d)", 377 "libinput_reset_pointer(%s) natural_scroll_set_enabled(%d)",
378 input_device->identifier, natural_scroll); 378 input_device->identifier, natural_scroll);
379 log_libinput_config_status( 379 log_libinput_config_status(
@@ -382,42 +382,42 @@ static void input_manager_libinput_reset_pointer(
382 382
383 double pointer_accel = 383 double pointer_accel =
384 libinput_device_config_accel_get_default_speed(libinput_device); 384 libinput_device_config_accel_get_default_speed(libinput_device);
385 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) accel_set_speed(%f)", 385 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) accel_set_speed(%f)",
386 input_device->identifier, pointer_accel); 386 input_device->identifier, pointer_accel);
387 log_libinput_config_status(libinput_device_config_accel_set_speed( 387 log_libinput_config_status(libinput_device_config_accel_set_speed(
388 libinput_device, pointer_accel)); 388 libinput_device, pointer_accel));
389 389
390 uint32_t scroll_button = 390 uint32_t scroll_button =
391 libinput_device_config_scroll_get_default_button(libinput_device); 391 libinput_device_config_scroll_get_default_button(libinput_device);
392 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) scroll_set_button(%d)", 392 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) scroll_set_button(%d)",
393 input_device->identifier, scroll_button); 393 input_device->identifier, scroll_button);
394 log_libinput_config_status(libinput_device_config_scroll_set_button( 394 log_libinput_config_status(libinput_device_config_scroll_set_button(
395 libinput_device, scroll_button)); 395 libinput_device, scroll_button));
396 396
397 enum libinput_config_scroll_method scroll_method = 397 enum libinput_config_scroll_method scroll_method =
398 libinput_device_config_scroll_get_default_method(libinput_device); 398 libinput_device_config_scroll_get_default_method(libinput_device);
399 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) scroll_set_method(%d)", 399 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) scroll_set_method(%d)",
400 input_device->identifier, scroll_method); 400 input_device->identifier, scroll_method);
401 log_libinput_config_status(libinput_device_config_scroll_set_method( 401 log_libinput_config_status(libinput_device_config_scroll_set_method(
402 libinput_device, scroll_method)); 402 libinput_device, scroll_method));
403 403
404 uint32_t send_events = 404 uint32_t send_events =
405 libinput_device_config_send_events_get_default_mode(libinput_device); 405 libinput_device_config_send_events_get_default_mode(libinput_device);
406 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) send_events_set_mode(%d)", 406 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) send_events_set_mode(%d)",
407 input_device->identifier, send_events); 407 input_device->identifier, send_events);
408 log_libinput_config_status(libinput_device_config_send_events_set_mode( 408 log_libinput_config_status(libinput_device_config_send_events_set_mode(
409 libinput_device, send_events)); 409 libinput_device, send_events));
410 410
411 enum libinput_config_tap_state tap = 411 enum libinput_config_tap_state tap =
412 libinput_device_config_tap_get_default_enabled(libinput_device); 412 libinput_device_config_tap_get_default_enabled(libinput_device);
413 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_enabled(%d)", 413 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_enabled(%d)",
414 input_device->identifier, tap); 414 input_device->identifier, tap);
415 log_libinput_config_status(libinput_device_config_tap_set_enabled( 415 log_libinput_config_status(libinput_device_config_tap_set_enabled(
416 libinput_device, tap)); 416 libinput_device, tap));
417 417
418 enum libinput_config_tap_button_map tap_button_map = 418 enum libinput_config_tap_button_map tap_button_map =
419 libinput_device_config_tap_get_button_map(libinput_device); 419 libinput_device_config_tap_get_button_map(libinput_device);
420 wlr_log(WLR_DEBUG, "libinput_reset_pointer(%s) tap_set_button_map(%d)", 420 sway_log(SWAY_DEBUG, "libinput_reset_pointer(%s) tap_set_button_map(%d)",
421 input_device->identifier, tap_button_map); 421 input_device->identifier, tap_button_map);
422 log_libinput_config_status(libinput_device_config_tap_set_button_map( 422 log_libinput_config_status(libinput_device_config_tap_set_button_map(
423 libinput_device, tap_button_map)); 423 libinput_device, tap_button_map));
@@ -432,7 +432,7 @@ static void handle_device_destroy(struct wl_listener *listener, void *data) {
432 return; 432 return;
433 } 433 }
434 434
435 wlr_log(WLR_DEBUG, "removing device: '%s'", 435 sway_log(SWAY_DEBUG, "removing device: '%s'",
436 input_device->identifier); 436 input_device->identifier);
437 437
438 struct sway_seat *seat = NULL; 438 struct sway_seat *seat = NULL;
@@ -462,7 +462,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
462 input_device->identifier = input_device_get_identifier(device); 462 input_device->identifier = input_device_get_identifier(device);
463 wl_list_insert(&input->devices, &input_device->link); 463 wl_list_insert(&input->devices, &input_device->link);
464 464
465 wlr_log(WLR_DEBUG, "adding device: '%s'", 465 sway_log(SWAY_DEBUG, "adding device: '%s'",
466 input_device->identifier); 466 input_device->identifier);
467 467
468 if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER || 468 if (input_device->wlr_device->type == WLR_INPUT_DEVICE_POINTER ||
@@ -504,7 +504,7 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
504 } 504 }
505 505
506 if (!added) { 506 if (!added) {
507 wlr_log(WLR_DEBUG, 507 sway_log(SWAY_DEBUG,
508 "device '%s' is not configured on any seats", 508 "device '%s' is not configured on any seats",
509 input_device->identifier); 509 input_device->identifier);
510 } 510 }
@@ -554,7 +554,7 @@ void handle_virtual_keyboard(struct wl_listener *listener, void *data) {
554 input_device->identifier = input_device_get_identifier(device); 554 input_device->identifier = input_device_get_identifier(device);
555 wl_list_insert(&input_manager->devices, &input_device->link); 555 wl_list_insert(&input_manager->devices, &input_device->link);
556 556
557 wlr_log(WLR_DEBUG, "adding virtual keyboard: '%s'", 557 sway_log(SWAY_DEBUG, "adding virtual keyboard: '%s'",
558 input_device->identifier); 558 input_device->identifier);
559 559
560 wl_signal_add(&device->events.destroy, &input_device->device_destroy); 560 wl_signal_add(&device->events.destroy, &input_device->device_destroy);
@@ -660,7 +660,7 @@ void input_manager_reset_all_inputs() {
660 660
661 661
662void input_manager_apply_seat_config(struct seat_config *seat_config) { 662void input_manager_apply_seat_config(struct seat_config *seat_config) {
663 wlr_log(WLR_DEBUG, "applying seat config for seat %s", seat_config->name); 663 sway_log(SWAY_DEBUG, "applying seat config for seat %s", seat_config->name);
664 if (strcmp(seat_config->name, "*") == 0) { 664 if (strcmp(seat_config->name, "*") == 0) {
665 struct sway_seat *seat = NULL; 665 struct sway_seat *seat = NULL;
666 wl_list_for_each(seat, &server.input->seats, link) { 666 wl_list_for_each(seat, &server.input->seats, link) {
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 }
diff --git a/sway/input/seat.c b/sway/input/seat.c
index a66a8198..82e0e754 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -62,7 +62,7 @@ static void seat_node_destroy(struct sway_seat_node *seat_node) {
62static void seat_send_activate(struct sway_node *node, struct sway_seat *seat) { 62static void seat_send_activate(struct sway_node *node, struct sway_seat *seat) {
63 if (node_is_view(node)) { 63 if (node_is_view(node)) {
64 if (!seat_is_input_allowed(seat, node->sway_container->view->surface)) { 64 if (!seat_is_input_allowed(seat, node->sway_container->view->surface)) {
65 wlr_log(WLR_DEBUG, "Refusing to set focus, input is inhibited"); 65 sway_log(SWAY_DEBUG, "Refusing to set focus, input is inhibited");
66 return; 66 return;
67 } 67 }
68 view_set_activated(node->sway_container->view, true); 68 view_set_activated(node->sway_container->view, true);
@@ -208,7 +208,7 @@ static struct sway_seat_node *seat_node_from_node(
208 208
209 seat_node = calloc(1, sizeof(struct sway_seat_node)); 209 seat_node = calloc(1, sizeof(struct sway_seat_node));
210 if (seat_node == NULL) { 210 if (seat_node == NULL) {
211 wlr_log(WLR_ERROR, "could not allocate seat node"); 211 sway_log(SWAY_ERROR, "could not allocate seat node");
212 return NULL; 212 return NULL;
213 } 213 }
214 214
@@ -289,7 +289,7 @@ static void handle_new_drag_icon(struct wl_listener *listener, void *data) {
289 289
290 struct sway_drag_icon *icon = calloc(1, sizeof(struct sway_drag_icon)); 290 struct sway_drag_icon *icon = calloc(1, sizeof(struct sway_drag_icon));
291 if (icon == NULL) { 291 if (icon == NULL) {
292 wlr_log(WLR_ERROR, "Allocation failed"); 292 sway_log(SWAY_ERROR, "Allocation failed");
293 return; 293 return;
294 } 294 }
295 icon->seat = seat; 295 icon->seat = seat;
@@ -407,7 +407,7 @@ static void seat_update_capabilities(struct sway_seat *seat) {
407 407
408static void seat_reset_input_config(struct sway_seat *seat, 408static void seat_reset_input_config(struct sway_seat *seat,
409 struct sway_seat_device *sway_device) { 409 struct sway_seat_device *sway_device) {
410 wlr_log(WLR_DEBUG, "Resetting output mapping for input device %s", 410 sway_log(SWAY_DEBUG, "Resetting output mapping for input device %s",
411 sway_device->input_device->identifier); 411 sway_device->input_device->identifier);
412 wlr_cursor_map_input_to_output(seat->cursor->cursor, 412 wlr_cursor_map_input_to_output(seat->cursor->cursor,
413 sway_device->input_device->wlr_device, NULL); 413 sway_device->input_device->wlr_device, NULL);
@@ -420,7 +420,7 @@ static void seat_apply_input_config(struct sway_seat *seat,
420 struct input_config *ic = input_device_get_config( 420 struct input_config *ic = input_device_get_config(
421 sway_device->input_device); 421 sway_device->input_device);
422 if (ic != NULL) { 422 if (ic != NULL) {
423 wlr_log(WLR_DEBUG, "Applying input config to %s", 423 sway_log(SWAY_DEBUG, "Applying input config to %s",
424 sway_device->input_device->identifier); 424 sway_device->input_device->identifier);
425 425
426 mapped_to_output = ic->mapped_to_output; 426 mapped_to_output = ic->mapped_to_output;
@@ -430,19 +430,19 @@ static void seat_apply_input_config(struct sway_seat *seat,
430 mapped_to_output = sway_device->input_device->wlr_device->output_name; 430 mapped_to_output = sway_device->input_device->wlr_device->output_name;
431 } 431 }
432 if (mapped_to_output != NULL) { 432 if (mapped_to_output != NULL) {
433 wlr_log(WLR_DEBUG, "Mapping input device %s to output %s", 433 sway_log(SWAY_DEBUG, "Mapping input device %s to output %s",
434 sway_device->input_device->identifier, mapped_to_output); 434 sway_device->input_device->identifier, mapped_to_output);
435 if (strcmp("*", mapped_to_output) == 0) { 435 if (strcmp("*", mapped_to_output) == 0) {
436 wlr_cursor_map_input_to_output(seat->cursor->cursor, 436 wlr_cursor_map_input_to_output(seat->cursor->cursor,
437 sway_device->input_device->wlr_device, NULL); 437 sway_device->input_device->wlr_device, NULL);
438 wlr_log(WLR_DEBUG, "Reset output mapping"); 438 sway_log(SWAY_DEBUG, "Reset output mapping");
439 return; 439 return;
440 } 440 }
441 struct sway_output *output = output_by_name_or_id(mapped_to_output); 441 struct sway_output *output = output_by_name_or_id(mapped_to_output);
442 if (output) { 442 if (output) {
443 wlr_cursor_map_input_to_output(seat->cursor->cursor, 443 wlr_cursor_map_input_to_output(seat->cursor->cursor,
444 sway_device->input_device->wlr_device, output->wlr_output); 444 sway_device->input_device->wlr_device, output->wlr_output);
445 wlr_log(WLR_DEBUG, "Mapped to output %s", output->wlr_output->name); 445 sway_log(SWAY_DEBUG, "Mapped to output %s", output->wlr_output->name);
446 } 446 }
447 } 447 }
448} 448}
@@ -522,10 +522,10 @@ void seat_configure_device(struct sway_seat *seat,
522 seat_configure_tablet_tool(seat, seat_device); 522 seat_configure_tablet_tool(seat, seat_device);
523 break; 523 break;
524 case WLR_INPUT_DEVICE_TABLET_PAD: 524 case WLR_INPUT_DEVICE_TABLET_PAD:
525 wlr_log(WLR_DEBUG, "TODO: configure tablet pad"); 525 sway_log(SWAY_DEBUG, "TODO: configure tablet pad");
526 break; 526 break;
527 case WLR_INPUT_DEVICE_SWITCH: 527 case WLR_INPUT_DEVICE_SWITCH:
528 wlr_log(WLR_DEBUG, "TODO: configure switch device"); 528 sway_log(SWAY_DEBUG, "TODO: configure switch device");
529 break; 529 break;
530 } 530 }
531} 531}
@@ -552,10 +552,10 @@ void seat_reset_device(struct sway_seat *seat,
552 seat_reset_input_config(seat, seat_device); 552 seat_reset_input_config(seat, seat_device);
553 break; 553 break;
554 case WLR_INPUT_DEVICE_TABLET_PAD: 554 case WLR_INPUT_DEVICE_TABLET_PAD:
555 wlr_log(WLR_DEBUG, "TODO: reset tablet pad"); 555 sway_log(SWAY_DEBUG, "TODO: reset tablet pad");
556 break; 556 break;
557 case WLR_INPUT_DEVICE_SWITCH: 557 case WLR_INPUT_DEVICE_SWITCH:
558 wlr_log(WLR_DEBUG, "TODO: reset switch device"); 558 sway_log(SWAY_DEBUG, "TODO: reset switch device");
559 break; 559 break;
560 } 560 }
561} 561}
@@ -570,11 +570,11 @@ void seat_add_device(struct sway_seat *seat,
570 struct sway_seat_device *seat_device = 570 struct sway_seat_device *seat_device =
571 calloc(1, sizeof(struct sway_seat_device)); 571 calloc(1, sizeof(struct sway_seat_device));
572 if (!seat_device) { 572 if (!seat_device) {
573 wlr_log(WLR_DEBUG, "could not allocate seat device"); 573 sway_log(SWAY_DEBUG, "could not allocate seat device");
574 return; 574 return;
575 } 575 }
576 576
577 wlr_log(WLR_DEBUG, "adding device %s to seat %s", 577 sway_log(SWAY_DEBUG, "adding device %s to seat %s",
578 input_device->identifier, seat->wlr_seat->name); 578 input_device->identifier, seat->wlr_seat->name);
579 579
580 seat_device->sway_seat = seat; 580 seat_device->sway_seat = seat;
@@ -594,7 +594,7 @@ void seat_remove_device(struct sway_seat *seat,
594 return; 594 return;
595 } 595 }
596 596
597 wlr_log(WLR_DEBUG, "removing device %s from seat %s", 597 sway_log(SWAY_DEBUG, "removing device %s from seat %s",
598 input_device->identifier, seat->wlr_seat->name); 598 input_device->identifier, seat->wlr_seat->name);
599 599
600 seat_device_destroy(seat_device); 600 seat_device_destroy(seat_device);
@@ -790,7 +790,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
790 wl_event_source_timer_update(view->urgent_timer, 790 wl_event_source_timer_update(view->urgent_timer,
791 config->urgent_timeout); 791 config->urgent_timeout);
792 } else { 792 } else {
793 wlr_log(WLR_ERROR, "Unable to create urgency timer (%s)", 793 sway_log(SWAY_ERROR, "Unable to create urgency timer (%s)",
794 strerror(errno)); 794 strerror(errno));
795 handle_urgent_timeout(view); 795 handle_urgent_timeout(view);
796 } 796 }