aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-22 23:10:06 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-22 23:10:19 +1000
commitd21d4b83a3effc56b177f5d505aedfdf2ddbbbd5 (patch)
tree5005c92ed70e19fcd9a316b9a9fad0d3ba07b6ad /sway/input
parentFix damage when shrinking a floating view using cursor (diff)
downloadsway-d21d4b83a3effc56b177f5d505aedfdf2ddbbbd5.tar.gz
sway-d21d4b83a3effc56b177f5d505aedfdf2ddbbbd5.tar.zst
sway-d21d4b83a3effc56b177f5d505aedfdf2ddbbbd5.zip
Set cursor when beginning resize and move operations
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c4
-rw-r--r--sway/input/seat.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index ee50dcde..771ad01d 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -215,6 +215,7 @@ static void calculate_floating_constraints(struct sway_container *con,
215 *max_height = config->floating_maximum_height; 215 *max_height = config->floating_maximum_height;
216 } 216 }
217} 217}
218
218static void handle_resize_motion(struct sway_seat *seat, 219static void handle_resize_motion(struct sway_seat *seat,
219 struct sway_cursor *cursor) { 220 struct sway_cursor *cursor) {
220 struct sway_container *con = seat->op_container; 221 struct sway_container *con = seat->op_container;
@@ -704,6 +705,9 @@ static void handle_request_set_cursor(struct wl_listener *listener,
704 void *data) { 705 void *data) {
705 struct sway_cursor *cursor = 706 struct sway_cursor *cursor =
706 wl_container_of(listener, cursor, request_set_cursor); 707 wl_container_of(listener, cursor, request_set_cursor);
708 if (cursor->seat->operation != OP_NONE) {
709 return;
710 }
707 struct wlr_seat_pointer_request_set_cursor_event *event = data; 711 struct wlr_seat_pointer_request_set_cursor_event *event = data;
708 712
709 struct wl_client *focused_client = NULL; 713 struct wl_client *focused_client = NULL;
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 4e803efd..273223db 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -910,6 +910,7 @@ void seat_begin_move(struct sway_seat *seat, struct sway_container *con,
910 seat->operation = OP_MOVE; 910 seat->operation = OP_MOVE;
911 seat->op_container = con; 911 seat->op_container = con;
912 seat->op_button = button; 912 seat->op_button = button;
913 cursor_set_image(seat->cursor, "grab", NULL);
913} 914}
914 915
915void seat_begin_resize(struct sway_seat *seat, struct sway_container *con, 916void seat_begin_resize(struct sway_seat *seat, struct sway_container *con,
@@ -932,6 +933,10 @@ void seat_begin_resize(struct sway_seat *seat, struct sway_container *con,
932 seat->op_ref_con_ly = con->y; 933 seat->op_ref_con_ly = con->y;
933 seat->op_ref_width = con->width; 934 seat->op_ref_width = con->width;
934 seat->op_ref_height = con->height; 935 seat->op_ref_height = con->height;
936
937 const char *image = edge == WLR_EDGE_NONE ?
938 "se-resize" : wlr_xcursor_get_resize_name(edge);
939 cursor_set_image(seat->cursor, image, NULL);
935} 940}
936 941
937void seat_end_mouse_operation(struct sway_seat *seat) { 942void seat_end_mouse_operation(struct sway_seat *seat) {
@@ -951,6 +956,7 @@ void seat_end_mouse_operation(struct sway_seat *seat) {
951 } 956 }
952 seat->operation = OP_NONE; 957 seat->operation = OP_NONE;
953 seat->op_container = NULL; 958 seat->op_container = NULL;
959 cursor_set_image(seat->cursor, "left_ptr", NULL);
954} 960}
955 961
956void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, 962void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec,