From a36625a482585e86d465df1eaa3669c1c4390a20 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 15 Aug 2018 16:47:02 +1000 Subject: Implement mousedown operation This allows you to move the cursor off the surface while dragging its scrollbar. --- include/sway/input/seat.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/sway') diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 9dfb0714..fb03b609 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -56,6 +56,7 @@ struct sway_seat { // Operations (drag and resize) enum { OP_NONE, + OP_MOUSEDOWN, OP_MOVE, OP_RESIZE_FLOATING, OP_RESIZE_TILING, @@ -157,6 +158,9 @@ 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_mousedown(struct sway_seat *seat, struct sway_container *con, + uint32_t button, double sx, double sy); + void seat_begin_move(struct sway_seat *seat, struct sway_container *con, uint32_t button); -- cgit v1.2.3 From b637b61a7a25219991280717d9bf8a463ed4d8a8 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 16 Aug 2018 09:12:48 +1000 Subject: Rename mousedown to down and make seat operation a named enum --- include/sway/input/seat.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'include/sway') diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index fb03b609..c07db61c 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -35,6 +35,14 @@ struct sway_drag_icon { struct wl_listener destroy; }; +enum sway_seat_operation { + OP_NONE, + OP_DOWN, + OP_MOVE, + OP_RESIZE_FLOATING, + OP_RESIZE_TILING, +}; + struct sway_seat { struct wlr_seat *wlr_seat; struct sway_cursor *cursor; @@ -54,14 +62,7 @@ struct sway_seat { double touch_x, touch_y; // Operations (drag and resize) - enum { - OP_NONE, - OP_MOUSEDOWN, - OP_MOVE, - OP_RESIZE_FLOATING, - OP_RESIZE_TILING, - } operation; - + enum sway_seat_operation operation; struct sway_container *op_container; enum wlr_edges op_resize_edge; uint32_t op_button; @@ -158,7 +159,7 @@ 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_mousedown(struct sway_seat *seat, struct sway_container *con, +void seat_begin_down(struct sway_seat *seat, struct sway_container *con, uint32_t button, double sx, double sy); void seat_begin_move(struct sway_seat *seat, struct sway_container *con, -- cgit v1.2.3 From 07a897b3b797b99022a9dfffffc0af2ff50aea85 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 18 Aug 2018 09:29:18 +1000 Subject: Don't send motion if the cursor hasn't moved Prevents GTK+ comboboxes from immediately closing. --- include/sway/input/seat.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sway') diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index c07db61c..5c404ecd 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -70,6 +70,7 @@ struct sway_seat { 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 + bool op_moved; // if the mouse moved during a down op uint32_t last_button; uint32_t last_button_serial; -- cgit v1.2.3