diff options
Diffstat (limited to 'include/sway/input')
-rw-r--r-- | include/sway/input/cursor.h | 9 | ||||
-rw-r--r-- | include/sway/input/input-manager.h | 3 | ||||
-rw-r--r-- | include/sway/input/libinput.h | 3 | ||||
-rw-r--r-- | include/sway/input/seat.h | 42 | ||||
-rw-r--r-- | include/sway/input/text_input.h | 3 |
5 files changed, 49 insertions, 11 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index 8a2898dd..1e21c66f 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h @@ -35,7 +35,6 @@ struct sway_cursor { pixman_region32_t confine; // invalid if active_constraint == NULL bool active_confine_requires_warp; - struct wlr_pointer_gestures_v1 *pointer_gestures; struct wl_listener hold_begin; struct wl_listener hold_end; struct wl_listener pinch_begin; @@ -53,6 +52,7 @@ struct sway_cursor { struct wl_listener touch_down; struct wl_listener touch_up; + struct wl_listener touch_cancel; struct wl_listener touch_motion; struct wl_listener touch_frame; bool simulating_pointer_from_touch; @@ -64,6 +64,7 @@ struct sway_cursor { struct wl_listener tool_proximity; struct wl_listener tool_button; bool simulating_pointer_from_tool_tip; + bool simulating_pointer_from_tool_button; uint32_t tool_buttons; struct wl_listener request_set_cursor; @@ -107,6 +108,10 @@ void cursor_unhide(struct sway_cursor *cursor); int cursor_get_timeout(struct sway_cursor *cursor); void cursor_notify_key_press(struct sway_cursor *cursor); +void pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, + struct wlr_input_device *device, double dx, double dy, + double dx_unaccel, double dy_unaccel); + void dispatch_cursor_button(struct sway_cursor *cursor, struct wlr_input_device *device, uint32_t time_msec, uint32_t button, enum wlr_button_state state); @@ -140,4 +145,6 @@ uint32_t get_mouse_button(const char *name, char **error); const char *get_mouse_button_name(uint32_t button); +void handle_request_set_cursor_shape(struct wl_listener *listener, void *data); + #endif diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index c9bd08f0..4bd51709 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h @@ -25,6 +25,7 @@ struct sway_input_manager { struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit; struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; struct wlr_virtual_pointer_manager_v1 *virtual_pointer; + struct wlr_pointer_gestures_v1 *pointer_gestures; struct wl_listener new_input; struct wl_listener inhibit_activate; @@ -44,7 +45,7 @@ void input_manager_configure_xcursor(void); void input_manager_apply_input_config(struct input_config *input_config); -void input_manager_configure_all_inputs(void); +void input_manager_configure_all_input_mappings(void); void input_manager_reset_input(struct sway_input_device *input_device); diff --git a/include/sway/input/libinput.h b/include/sway/input/libinput.h index e4b1acc3..1f84a8e3 100644 --- a/include/sway/input/libinput.h +++ b/include/sway/input/libinput.h @@ -4,6 +4,9 @@ bool sway_input_configure_libinput_device(struct sway_input_device *device); +void sway_input_configure_libinput_device_send_events( + struct sway_input_device *device); + void sway_input_reset_libinput_device(struct sway_input_device *device); bool sway_libinput_device_is_builtin(struct sway_input_device *device); diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index e3a46872..6063ead3 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -4,6 +4,7 @@ #include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> #include <wlr/types/wlr_layer_shell_v1.h> #include <wlr/types/wlr_seat.h> +#include <wlr/types/wlr_touch.h> #include <wlr/util/edges.h> #include "sway/config.h" #include "sway/input/input-manager.h" @@ -11,6 +12,7 @@ #include "sway/input/text_input.h" struct sway_seat; +struct fx_render_context; struct sway_seatop_impl { void (*button)(struct sway_seat *seat, uint32_t time_msec, @@ -36,14 +38,21 @@ struct sway_seatop_impl { void (*swipe_end)(struct sway_seat *seat, struct wlr_pointer_swipe_end_event *event); void (*rebase)(struct sway_seat *seat, uint32_t time_msec); + void (*touch_motion)(struct sway_seat *seat, + struct wlr_touch_motion_event *event, double lx, double ly); + void (*touch_up)(struct sway_seat *seat, + struct wlr_touch_up_event *event); + void (*touch_down)(struct sway_seat *seat, + struct wlr_touch_down_event *event, double lx, double ly); + void (*touch_cancel)(struct sway_seat *seat, + struct wlr_touch_cancel_event *event); void (*tablet_tool_motion)(struct sway_seat *seat, struct sway_tablet_tool *tool, uint32_t time_msec); void (*tablet_tool_tip)(struct sway_seat *seat, struct sway_tablet_tool *tool, uint32_t time_msec, enum wlr_tablet_tool_tip_state state); void (*end)(struct sway_seat *seat); void (*unref)(struct sway_seat *seat, struct sway_container *con); - void (*render)(struct sway_seat *seat, struct sway_output *output, - pixman_region32_t *damage); + void (*render)(struct sway_seat *seat, struct fx_render_context *ctx); bool allow_set_cursor; }; @@ -72,6 +81,7 @@ struct sway_drag_icon { struct wl_list link; // sway_root::drag_icons double x, y; // in layout-local coordinates + int dx, dy; // offset in surface-local coordinates struct wl_listener surface_commit; struct wl_listener map; @@ -94,8 +104,9 @@ struct sway_seat { struct sway_workspace *workspace; char *prev_workspace_name; // for workspace back_and_forth - // If the focused layer is set, views cannot receive keyboard focus struct wlr_layer_surface_v1 *focused_layer; + // If the exclusive layer is set, views cannot receive keyboard focus + bool has_exclusive_layer; // If exclusive_client is set, no other clients will receive input events struct wl_client *exclusive_client; @@ -157,6 +168,9 @@ void seat_add_device(struct sway_seat *seat, void seat_configure_device(struct sway_seat *seat, struct sway_input_device *device); +void seat_configure_device_mapping(struct sway_seat *seat, + struct sway_input_device *input_device); + void seat_reset_device(struct sway_seat *seat, struct sway_input_device *input_device); @@ -255,10 +269,13 @@ enum wlr_edges find_resize_edge(struct sway_container *cont, void seatop_begin_default(struct sway_seat *seat); void seatop_begin_down(struct sway_seat *seat, struct sway_container *con, - uint32_t time_msec, double sx, double sy); + double sx, double sy); void seatop_begin_down_on_surface(struct sway_seat *seat, - struct wlr_surface *surface, uint32_t time_msec, double sx, double sy); + struct wlr_surface *surface, double sx, double sy); + +void seatop_begin_touch_down(struct sway_seat *seat, struct wlr_surface *surface, + struct wlr_touch_down_event *event, double sx, double sy, double lx, double ly); void seatop_begin_move_floating(struct sway_seat *seat, struct sway_container *con); @@ -318,6 +335,18 @@ void seatop_swipe_update(struct sway_seat *seat, void seatop_swipe_end(struct sway_seat *seat, struct wlr_pointer_swipe_end_event *event); +void seatop_touch_motion(struct sway_seat *seat, + struct wlr_touch_motion_event *event, double lx, double ly); + +void seatop_touch_up(struct sway_seat *seat, + struct wlr_touch_up_event *event); + +void seatop_touch_down(struct sway_seat *seat, + struct wlr_touch_down_event *event, double lx, double ly); + +void seatop_touch_cancel(struct sway_seat *seat, + struct wlr_touch_cancel_event *event); + void seatop_rebase(struct sway_seat *seat, uint32_t time_msec); /** @@ -336,8 +365,7 @@ void seatop_unref(struct sway_seat *seat, struct sway_container *con); * Instructs a seatop to render anything that it needs to render * (eg. dropzone for move-tiling) */ -void seatop_render(struct sway_seat *seat, struct sway_output *output, - pixman_region32_t *damage); +void seatop_render(struct sway_seat *seat, struct fx_render_context *ctx); bool seatop_allows_set_cursor(struct sway_seat *seat); diff --git a/include/sway/input/text_input.h b/include/sway/input/text_input.h index c70fd935..214e61d1 100644 --- a/include/sway/input/text_input.h +++ b/include/sway/input/text_input.h @@ -4,12 +4,11 @@ #include <wlr/types/wlr_text_input_v3.h> #include <wlr/types/wlr_input_method_v2.h> #include <wlr/types/wlr_compositor.h> -#include "sway/input/seat.h" /** * The relay structure manages the relationship between text-input and * input_method interfaces on a given seat. Multiple text-input interfaces may - * be bound to a relay, but at most one will be focused (reveiving events) at + * be bound to a relay, but at most one will be focused (receiving events) at * a time. At most one input-method interface may be bound to the seat. The * relay manages life cycle of both sides. When both sides are present and * focused, the relay passes messages between them. |