aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/input-manager.c45
-rw-r--r--sway/input/seat.c18
2 files changed, 42 insertions, 21 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index d9d20200..34d5b4cf 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -92,7 +92,8 @@ static bool input_has_seat_configuration(struct sway_input_manager *input) {
return false;
}
-static void input_manager_libinput_config_pointer(struct sway_input_device *input_device) {
+static void input_manager_libinput_config_pointer(
+ struct sway_input_device *input_device) {
struct wlr_input_device *wlr_device = input_device->wlr_device;
struct input_config *ic = input_device->config;
struct libinput_device *libinput_device;
@@ -102,22 +103,27 @@ static void input_manager_libinput_config_pointer(struct sway_input_device *inpu
}
libinput_device = wlr_libinput_get_device_handle(wlr_device);
- wlr_log(L_DEBUG, "input_manager_libinput_config_pointer(%s)", ic->identifier);
+ wlr_log(L_DEBUG, "input_manager_libinput_config_pointer(%s)",
+ ic->identifier);
if (ic->accel_profile != INT_MIN) {
wlr_log(L_DEBUG, "libinput_config_pointer(%s) accel_set_profile(%d)",
ic->identifier, ic->accel_profile);
- libinput_device_config_accel_set_profile(libinput_device, ic->accel_profile);
+ libinput_device_config_accel_set_profile(libinput_device,
+ ic->accel_profile);
}
if (ic->click_method != INT_MIN) {
wlr_log(L_DEBUG, "libinput_config_pointer(%s) click_set_method(%d)",
ic->identifier, ic->click_method);
- libinput_device_config_click_set_method(libinput_device, ic->click_method);
+ libinput_device_config_click_set_method(libinput_device,
+ ic->click_method);
}
if (ic->drag_lock != INT_MIN) {
- wlr_log(L_DEBUG, "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)",
+ wlr_log(L_DEBUG,
+ "libinput_config_pointer(%s) tap_set_drag_lock_enabled(%d)",
ic->identifier, ic->click_method);
- libinput_device_config_tap_set_drag_lock_enabled(libinput_device, ic->drag_lock);
+ libinput_device_config_tap_set_drag_lock_enabled(libinput_device,
+ ic->drag_lock);
}
if (ic->dwt != INT_MIN) {
wlr_log(L_DEBUG, "libinput_config_pointer(%s) dwt_set_enabled(%d)",
@@ -125,34 +131,43 @@ static void input_manager_libinput_config_pointer(struct sway_input_device *inpu
libinput_device_config_dwt_set_enabled(libinput_device, ic->dwt);
}
if (ic->left_handed != INT_MIN) {
- wlr_log(L_DEBUG, "libinput_config_pointer(%s) left_handed_set_enabled(%d)",
+ wlr_log(L_DEBUG,
+ "libinput_config_pointer(%s) left_handed_set_enabled(%d)",
ic->identifier, ic->left_handed);
- libinput_device_config_left_handed_set(libinput_device, ic->left_handed);
+ libinput_device_config_left_handed_set(libinput_device,
+ ic->left_handed);
}
if (ic->middle_emulation != INT_MIN) {
- wlr_log(L_DEBUG, "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)",
+ wlr_log(L_DEBUG,
+ "libinput_config_pointer(%s) middle_emulation_set_enabled(%d)",
ic->identifier, ic->middle_emulation);
- libinput_device_config_middle_emulation_set_enabled(libinput_device, ic->middle_emulation);
+ libinput_device_config_middle_emulation_set_enabled(libinput_device,
+ ic->middle_emulation);
}
if (ic->natural_scroll != INT_MIN) {
- wlr_log(L_DEBUG, "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)",
+ wlr_log(L_DEBUG,
+ "libinput_config_pointer(%s) natural_scroll_set_enabled(%d)",
ic->identifier, ic->natural_scroll);
- libinput_device_config_scroll_set_natural_scroll_enabled(libinput_device, ic->natural_scroll);
+ libinput_device_config_scroll_set_natural_scroll_enabled(
+ libinput_device, ic->natural_scroll);
}
if (ic->pointer_accel != FLT_MIN) {
wlr_log(L_DEBUG, "libinput_config_pointer(%s) accel_set_speed(%f)",
ic->identifier, ic->pointer_accel);
- libinput_device_config_accel_set_speed(libinput_device, ic->pointer_accel);
+ libinput_device_config_accel_set_speed(libinput_device,
+ ic->pointer_accel);
}
if (ic->scroll_method != INT_MIN) {
wlr_log(L_DEBUG, "libinput_config_pointer(%s) scroll_set_method(%d)",
ic->identifier, ic->scroll_method);
- libinput_device_config_scroll_set_method(libinput_device, ic->scroll_method);
+ libinput_device_config_scroll_set_method(libinput_device,
+ ic->scroll_method);
}
if (ic->send_events != INT_MIN) {
wlr_log(L_DEBUG, "libinput_config_pointer(%s) send_events_set_mode(%d)",
ic->identifier, ic->send_events);
- libinput_device_config_send_events_set_mode(libinput_device, ic->send_events);
+ libinput_device_config_send_events_set_mode(libinput_device,
+ ic->send_events);
}
if (ic->tap != INT_MIN) {
wlr_log(L_DEBUG, "libinput_config_pointer(%s) tap_set_enabled(%d)",
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 91a9e32b..38b617b7 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -49,7 +49,8 @@ static void handle_seat_container_destroy(struct wl_listener *listener,
if (is_focus) {
// pick next focus
seat_set_focus(seat, NULL);
- struct sway_container *next = seat_get_focus_inactive(seat, con->parent);
+ struct sway_container *next =
+ seat_get_focus_inactive(seat, con->parent);
if (next == NULL) {
next = con->parent;
}
@@ -133,7 +134,8 @@ struct sway_seat *seat_create(struct sway_input_manager *input,
// init the focus stack
wl_list_init(&seat->focus_stack);
- container_for_each_descendant_dfs(&root_container, collect_focus_iter, seat);
+ container_for_each_descendant_dfs(&root_container,
+ collect_focus_iter, seat);
wl_signal_add(&root_container.sway_root->events.new_container,
&seat->new_container);
@@ -165,7 +167,8 @@ static void seat_configure_keyboard(struct sway_seat *seat,
if (!seat_device->keyboard) {
sway_keyboard_create(seat, seat_device);
}
- struct wlr_keyboard *wlr_keyboard = seat_device->input_device->wlr_device->keyboard;
+ struct wlr_keyboard *wlr_keyboard =
+ seat_device->input_device->wlr_device->keyboard;
sway_keyboard_configure(seat_device->keyboard);
wlr_seat_set_keyboard(seat->wlr_seat,
seat_device->input_device->wlr_device);
@@ -275,7 +278,8 @@ void seat_configure_xcursor(struct sway_seat *seat) {
}
for (int i = 0; i < root_container.children->length; ++i) {
- struct sway_container *output_container = root_container.children->items[i];
+ struct sway_container *output_container =
+ root_container.children->items[i];
struct wlr_output *output =
output_container->sway_output->wlr_output;
bool result =
@@ -379,7 +383,8 @@ void seat_set_focus(struct sway_seat *seat,
seat_set_focus_warp(seat, container, true);
}
-struct sway_container *seat_get_focus_inactive(struct sway_seat *seat, struct sway_container *container) {
+struct sway_container *seat_get_focus_inactive(struct sway_seat *seat,
+ struct sway_container *container) {
struct sway_seat_container *current = NULL;
struct sway_container *parent = NULL;
wl_list_for_each(current, &seat->focus_stack, link) {
@@ -409,7 +414,8 @@ struct sway_container *seat_get_focus(struct sway_seat *seat) {
struct sway_container *seat_get_focus_by_type(struct sway_seat *seat,
enum sway_container_type type) {
- struct sway_container *focus = seat_get_focus_inactive(seat, &root_container);
+ struct sway_container *focus =
+ seat_get_focus_inactive(seat, &root_container);
if (focus->type == type) {
return focus;
}