diff options
-rw-r--r-- | include/sway/tree/layout.h | 10 | ||||
-rw-r--r-- | sway/commands/resize.c | 9 | ||||
-rw-r--r-- | sway/input/seat.c | 2 | ||||
-rw-r--r-- | sway/tree/layout.c | 6 |
4 files changed, 11 insertions, 16 deletions
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h index 5b803dfe..519189d9 100644 --- a/include/sway/tree/layout.h +++ b/include/sway/tree/layout.h | |||
@@ -15,13 +15,7 @@ enum movement_direction { | |||
15 | MOVE_CHILD, | 15 | MOVE_CHILD, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | enum resize_edge { | 18 | enum wlr_edges; |
19 | RESIZE_EDGE_NONE = 0, | ||
20 | RESIZE_EDGE_LEFT = 1, | ||
21 | RESIZE_EDGE_RIGHT = 2, | ||
22 | RESIZE_EDGE_TOP = 4, | ||
23 | RESIZE_EDGE_BOTTOM = 8, | ||
24 | }; | ||
25 | 19 | ||
26 | struct sway_container; | 20 | struct sway_container; |
27 | 21 | ||
@@ -52,7 +46,7 @@ struct sway_container *container_split(struct sway_container *child, | |||
52 | enum sway_container_layout layout); | 46 | enum sway_container_layout layout); |
53 | 47 | ||
54 | void container_recursive_resize(struct sway_container *container, | 48 | void container_recursive_resize(struct sway_container *container, |
55 | double amount, enum resize_edge edge); | 49 | double amount, enum wlr_edges edge); |
56 | 50 | ||
57 | void container_swap(struct sway_container *con1, struct sway_container *con2); | 51 | void container_swap(struct sway_container *con1, struct sway_container *con2); |
58 | 52 | ||
diff --git a/sway/commands/resize.c b/sway/commands/resize.c index 0f3005f4..ea1e36ff 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <stdlib.h> | 5 | #include <stdlib.h> |
6 | #include <string.h> | 6 | #include <string.h> |
7 | #include <strings.h> | 7 | #include <strings.h> |
8 | #include <wlr/util/edges.h> | ||
8 | #include <wlr/util/log.h> | 9 | #include <wlr/util/log.h> |
9 | #include "sway/commands.h" | 10 | #include "sway/commands.h" |
10 | #include "sway/tree/arrange.h" | 11 | #include "sway/tree/arrange.h" |
@@ -250,10 +251,10 @@ static void resize_tiled(struct sway_container *parent, int amount, | |||
250 | } | 251 | } |
251 | } | 252 | } |
252 | 253 | ||
253 | enum resize_edge minor_edge = axis == RESIZE_AXIS_HORIZONTAL ? | 254 | enum wlr_edges minor_edge = axis == RESIZE_AXIS_HORIZONTAL ? |
254 | RESIZE_EDGE_LEFT : RESIZE_EDGE_TOP; | 255 | WLR_EDGE_LEFT : WLR_EDGE_TOP; |
255 | enum resize_edge major_edge = axis == RESIZE_AXIS_HORIZONTAL ? | 256 | enum wlr_edges major_edge = axis == RESIZE_AXIS_HORIZONTAL ? |
256 | RESIZE_EDGE_RIGHT : RESIZE_EDGE_BOTTOM; | 257 | WLR_EDGE_RIGHT : WLR_EDGE_BOTTOM; |
257 | 258 | ||
258 | for (int i = 0; i < parent->parent->children->length; i++) { | 259 | for (int i = 0; i < parent->parent->children->length; i++) { |
259 | struct sway_container *sibling = parent->parent->children->items[i]; | 260 | struct sway_container *sibling = parent->parent->children->items[i]; |
diff --git a/sway/input/seat.c b/sway/input/seat.c index caee37a6..4077a8dd 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -984,7 +984,7 @@ void seat_begin_resize_floating(struct sway_seat *seat, | |||
984 | seat->op_resize_preserve_ratio = keyboard && | 984 | seat->op_resize_preserve_ratio = keyboard && |
985 | (wlr_keyboard_get_modifiers(keyboard) & WLR_MODIFIER_SHIFT); | 985 | (wlr_keyboard_get_modifiers(keyboard) & WLR_MODIFIER_SHIFT); |
986 | seat->op_resize_edge = edge == WLR_EDGE_NONE ? | 986 | seat->op_resize_edge = edge == WLR_EDGE_NONE ? |
987 | RESIZE_EDGE_BOTTOM | RESIZE_EDGE_RIGHT : edge; | 987 | WLR_EDGE_BOTTOM | WLR_EDGE_RIGHT : edge; |
988 | seat->op_button = button; | 988 | seat->op_button = button; |
989 | seat->op_ref_lx = seat->cursor->cursor->x; | 989 | seat->op_ref_lx = seat->cursor->cursor->x; |
990 | seat->op_ref_ly = seat->cursor->cursor->y; | 990 | seat->op_ref_ly = seat->cursor->cursor->y; |
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index ee7d7418..a3de44ce 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -876,13 +876,13 @@ struct sway_container *container_split(struct sway_container *child, | |||
876 | } | 876 | } |
877 | 877 | ||
878 | void container_recursive_resize(struct sway_container *container, | 878 | void container_recursive_resize(struct sway_container *container, |
879 | double amount, enum resize_edge edge) { | 879 | double amount, enum wlr_edges edge) { |
880 | bool layout_match = true; | 880 | bool layout_match = true; |
881 | wlr_log(WLR_DEBUG, "Resizing %p with amount: %f", container, amount); | 881 | wlr_log(WLR_DEBUG, "Resizing %p with amount: %f", container, amount); |
882 | if (edge == RESIZE_EDGE_LEFT || edge == RESIZE_EDGE_RIGHT) { | 882 | if (edge == WLR_EDGE_LEFT || edge == WLR_EDGE_RIGHT) { |
883 | container->width += amount; | 883 | container->width += amount; |
884 | layout_match = container->layout == L_HORIZ; | 884 | layout_match = container->layout == L_HORIZ; |
885 | } else if (edge == RESIZE_EDGE_TOP || edge == RESIZE_EDGE_BOTTOM) { | 885 | } else if (edge == WLR_EDGE_TOP || edge == WLR_EDGE_BOTTOM) { |
886 | container->height += amount; | 886 | container->height += amount; |
887 | layout_match = container->layout == L_VERT; | 887 | layout_match = container->layout == L_VERT; |
888 | } | 888 | } |