diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-10 14:10:09 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-12 10:45:54 +1000 |
commit | b4a0363d1721b2ad2d5afb65764ecb575bd55fa4 (patch) | |
tree | f6ec316550cd113040e82a7f0cee0429fff349e5 /common | |
parent | Merge pull request #2452 from janza/position-command-fix-args (diff) | |
download | sway-b4a0363d1721b2ad2d5afb65764ecb575bd55fa4.tar.gz sway-b4a0363d1721b2ad2d5afb65764ecb575bd55fa4.tar.zst sway-b4a0363d1721b2ad2d5afb65764ecb575bd55fa4.zip |
Implement resizing tiled containers via cursor
* The OP_RESIZE seat operation has been renamed to OP_RESIZE_FLOATING,
and OP_RESIZE_TILING has been introduced.
* Similar to the above, seat_begin_resize and handle_resize_motion have
been renamed and tiling variants introduced.
* resize.c's resize_tiled has to be used, so container_resize_tiled has
been introduced in resize.c to allow external code to call it.
Diffstat (limited to 'common')
-rw-r--r-- | common/list.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/list.c b/common/list.c index 66d52f70..a3a22d8f 100644 --- a/common/list.c +++ b/common/list.c | |||
@@ -77,6 +77,15 @@ int list_seq_find(list_t *list, int compare(const void *item, const void *data), | |||
77 | return -1; | 77 | return -1; |
78 | } | 78 | } |
79 | 79 | ||
80 | int list_find(list_t *list, void *item) { | ||
81 | for (int i = 0; i < list->length; i++) { | ||
82 | if (list->items[i] == item) { | ||
83 | return i; | ||
84 | } | ||
85 | } | ||
86 | return -1; | ||
87 | } | ||
88 | |||
80 | void list_swap(list_t *list, int src, int dest) { | 89 | void list_swap(list_t *list, int src, int dest) { |
81 | void *tmp = list->items[src]; | 90 | void *tmp = list->items[src]; |
82 | list->items[src] = list->items[dest]; | 91 | list->items[src] = list->items[dest]; |