diff options
-rw-r--r-- | sway/input/cursor.c | 26 | ||||
-rw-r--r-- | sway/input/seat.c | 3 |
2 files changed, 23 insertions, 6 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 12cca7fd..8e7157a2 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -472,9 +472,17 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, | |||
472 | } else if (c) { | 472 | } else if (c) { |
473 | // Try a container's resize edge | 473 | // Try a container's resize edge |
474 | enum wlr_edges edge = find_resize_edge(c, cursor); | 474 | enum wlr_edges edge = find_resize_edge(c, cursor); |
475 | const char *image = edge == WLR_EDGE_NONE ? | 475 | if (edge == WLR_EDGE_NONE) { |
476 | "left_ptr" : wlr_xcursor_get_resize_name(edge); | 476 | cursor_set_image(cursor, "left_ptr", NULL); |
477 | cursor_set_image(cursor, image, NULL); | 477 | } else if (container_is_floating(c)) { |
478 | cursor_set_image(cursor, wlr_xcursor_get_resize_name(edge), NULL); | ||
479 | } else { | ||
480 | if (edge & (WLR_EDGE_LEFT | WLR_EDGE_RIGHT)) { | ||
481 | cursor_set_image(cursor, "col-resize", NULL); | ||
482 | } else { | ||
483 | cursor_set_image(cursor, "row-resize", NULL); | ||
484 | } | ||
485 | } | ||
478 | } else { | 486 | } else { |
479 | cursor_set_image(cursor, "left_ptr", NULL); | 487 | cursor_set_image(cursor, "left_ptr", NULL); |
480 | } | 488 | } |
@@ -676,6 +684,18 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
676 | WLR_EDGE_RIGHT : WLR_EDGE_LEFT; | 684 | WLR_EDGE_RIGHT : WLR_EDGE_LEFT; |
677 | edge |= cursor->cursor->y > cont->y + cont->height / 2 ? | 685 | edge |= cursor->cursor->y > cont->y + cont->height / 2 ? |
678 | WLR_EDGE_BOTTOM : WLR_EDGE_TOP; | 686 | WLR_EDGE_BOTTOM : WLR_EDGE_TOP; |
687 | |||
688 | const char *image = NULL; | ||
689 | if (edge == (WLR_EDGE_LEFT | WLR_EDGE_TOP)) { | ||
690 | image = "nw-resize"; | ||
691 | } else if (edge == (WLR_EDGE_TOP | WLR_EDGE_RIGHT)) { | ||
692 | image = "ne-resize"; | ||
693 | } else if (edge == (WLR_EDGE_RIGHT | WLR_EDGE_BOTTOM)) { | ||
694 | image = "se-resize"; | ||
695 | } else if (edge == (WLR_EDGE_BOTTOM | WLR_EDGE_LEFT)) { | ||
696 | image = "sw-resize"; | ||
697 | } | ||
698 | cursor_set_image(seat->cursor, image, NULL); | ||
679 | seat_set_focus(seat, cont); | 699 | seat_set_focus(seat, cont); |
680 | seat_begin_resize_tiling(seat, cont, button, edge); | 700 | seat_begin_resize_tiling(seat, cont, button, edge); |
681 | return; | 701 | return; |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 6d9e85dc..57cc65f6 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -980,9 +980,6 @@ void seat_begin_resize_tiling(struct sway_seat *seat, | |||
980 | seat->op_ref_con_ly = con->y; | 980 | seat->op_ref_con_ly = con->y; |
981 | seat->op_ref_width = con->width; | 981 | seat->op_ref_width = con->width; |
982 | seat->op_ref_height = con->height; | 982 | seat->op_ref_height = con->height; |
983 | |||
984 | const char *image = wlr_xcursor_get_resize_name(edge); | ||
985 | cursor_set_image(seat->cursor, image, NULL); | ||
986 | } | 983 | } |
987 | 984 | ||
988 | void seat_end_mouse_operation(struct sway_seat *seat) { | 985 | void seat_end_mouse_operation(struct sway_seat *seat) { |