aboutsummaryrefslogtreecommitdiffstats
path: root/common/list.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-10 14:10:09 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-12 10:45:54 +1000
commitb4a0363d1721b2ad2d5afb65764ecb575bd55fa4 (patch)
treef6ec316550cd113040e82a7f0cee0429fff349e5 /common/list.c
parentMerge pull request #2452 from janza/position-command-fix-args (diff)
downloadsway-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/list.c')
-rw-r--r--common/list.c9
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
80int 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
80void list_swap(list_t *list, int src, int dest) { 89void 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];