diff options
Diffstat (limited to 'include/sway/input')
-rw-r--r-- | include/sway/input/cursor.h | 4 | ||||
-rw-r--r-- | include/sway/input/seat.h | 43 |
2 files changed, 35 insertions, 12 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index 5dd109ca..b0a3a7c5 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h @@ -11,6 +11,7 @@ struct sway_cursor { } previous; struct wlr_xcursor_manager *xcursor_manager; + const char *image; struct wl_client *image_client; struct wl_listener motion; @@ -37,4 +38,7 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, void dispatch_cursor_button(struct sway_cursor *cursor, uint32_t time_msec, uint32_t button, enum wlr_button_state state); +void cursor_set_image(struct sway_cursor *cursor, const char *image, + struct wl_client *client); + #endif diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 0e440701..ab25788f 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -3,6 +3,7 @@ #include <wlr/types/wlr_layer_shell.h> #include <wlr/types/wlr_seat.h> +#include <wlr/util/edges.h> #include "sway/input/input-manager.h" struct sway_seat_device { @@ -52,6 +53,24 @@ struct sway_seat { int32_t touch_id; double touch_x, touch_y; + // Operations (drag and resize) + enum { + OP_NONE, + OP_MOVE, + OP_RESIZE, + } operation; + + struct sway_container *op_container; + enum wlr_edges op_resize_edge; + uint32_t op_button; + bool op_resize_preserve_ratio; + double op_ref_lx, op_ref_ly; // cursor's x/y at start of op + double op_ref_width, op_ref_height; // container's size at start of op + double op_ref_con_lx, op_ref_con_ly; // container's x/y at start of op + + uint32_t last_button; + uint32_t last_button_serial; + struct wl_listener focus_destroy; struct wl_listener new_container; struct wl_listener new_drag_icon; @@ -83,7 +102,7 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_container *container, bool warp); void seat_set_focus_surface(struct sway_seat *seat, - struct wlr_surface *surface); + struct wlr_surface *surface, bool unfocus); void seat_set_focus_layer(struct sway_seat *seat, struct wlr_layer_surface *layer); @@ -119,17 +138,6 @@ struct sway_container *seat_get_active_child(struct sway_seat *seat, struct sway_container *container); /** - * Return the immediate child of container which was most recently focused, with - * fallback to selecting the child in the parent's `current` (rendered) children - * list. - * - * This is useful for when a tabbed container and its children are destroyed but - * still being rendered, and we have to render an appropriate child. - */ -struct sway_container *seat_get_active_current_child(struct sway_seat *seat, - struct sway_container *container); - -/** * Iterate over the focus-inactive children of the container calling the * function on each. */ @@ -145,4 +153,15 @@ bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); void drag_icon_update_position(struct sway_drag_icon *icon); +void seat_begin_move(struct sway_seat *seat, struct sway_container *con, + uint32_t button); + +void seat_begin_resize(struct sway_seat *seat, struct sway_container *con, + uint32_t button, enum wlr_edges edge); + +void seat_end_mouse_operation(struct sway_seat *seat); + +void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, + uint32_t button, enum wlr_button_state state); + #endif |