diff options
author | emersion <contact@emersion.fr> | 2018-08-02 23:49:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 23:49:25 +0100 |
commit | 3a54e2291c017397ceff60511c29fe70d229bc8b (patch) | |
tree | d340b7776f945462f5ecffc830ada4d5fbe82f51 /include/sway/input | |
parent | c35a34262f8da368f65d37f811a2264647e0dae6 (diff) | |
parent | e07da5fc5c6ac5c186662b56b08ca71531119de0 (diff) |
Merge branch 'master' into wlr-gamma-control
Diffstat (limited to 'include/sway/input')
-rw-r--r-- | include/sway/input/cursor.h | 10 | ||||
-rw-r--r-- | include/sway/input/input-manager.h | 3 | ||||
-rw-r--r-- | include/sway/input/keyboard.h | 3 | ||||
-rw-r--r-- | include/sway/input/seat.h | 35 |
4 files changed, 50 insertions, 1 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h index 5dd109ca..7ec45120 100644 --- a/include/sway/input/cursor.h +++ b/include/sway/input/cursor.h @@ -3,6 +3,8 @@ #include <stdint.h> #include "sway/input/seat.h" +#define SWAY_CURSOR_PRESSED_BUTTONS_CAP 32 + struct sway_cursor { struct sway_seat *seat; struct wlr_cursor *cursor; @@ -11,6 +13,7 @@ struct sway_cursor { } previous; struct wlr_xcursor_manager *xcursor_manager; + const char *image; struct wl_client *image_client; struct wl_listener motion; @@ -28,6 +31,10 @@ struct sway_cursor { uint32_t tool_buttons; struct wl_listener request_set_cursor; + + // Mouse binding state + uint32_t pressed_buttons[SWAY_CURSOR_PRESSED_BUTTONS_CAP]; + size_t pressed_button_count; }; void sway_cursor_destroy(struct sway_cursor *cursor); @@ -37,4 +44,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/input-manager.h b/include/sway/input/input-manager.h index 89a3ac71..aa2f6f19 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h @@ -2,6 +2,7 @@ #define _SWAY_INPUT_INPUT_MANAGER_H #include <libinput.h> #include <wlr/types/wlr_input_inhibitor.h> +#include <wlr/types/wlr_virtual_keyboard_v1.h> #include "sway/server.h" #include "sway/config.h" #include "list.h" @@ -25,10 +26,12 @@ struct sway_input_manager { struct wl_list seats; struct wlr_input_inhibit_manager *inhibit; + struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; struct wl_listener new_input; struct wl_listener inhibit_activate; struct wl_listener inhibit_deactivate; + struct wl_listener virtual_keyboard_new; }; struct sway_input_manager *input_manager_create(struct sway_server *server); diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h index 6713398e..6d28454c 100644 --- a/include/sway/input/keyboard.h +++ b/include/sway/input/keyboard.h @@ -38,6 +38,9 @@ struct sway_keyboard { struct sway_shortcut_state state_keysyms_raw; struct sway_shortcut_state state_keycodes; struct sway_binding *held_binding; + + struct wl_event_source *key_repeat_source; + struct sway_binding *repeat_binding; }; struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index eac1626b..92387601 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; @@ -80,7 +99,7 @@ void seat_configure_xcursor(struct sway_seat *seat); void seat_set_focus(struct sway_seat *seat, struct sway_container *container); void seat_set_focus_warp(struct sway_seat *seat, - struct sway_container *container, bool warp); + struct sway_container *container, bool warp, bool notify); void seat_set_focus_surface(struct sway_seat *seat, struct wlr_surface *surface, bool unfocus); @@ -105,6 +124,9 @@ struct sway_container *seat_get_focus(struct sway_seat *seat); struct sway_container *seat_get_focus_inactive(struct sway_seat *seat, struct sway_container *container); +struct sway_container *seat_get_focus_inactive_tiling(struct sway_seat *seat, + struct sway_container *container); + /** * Descend into the focus stack to find the focus-inactive view. Useful for * container placement when they change position in the tree. @@ -134,4 +156,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 |