aboutsummaryrefslogtreecommitdiff
path: root/common/list.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-08-10 14:10:09 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-08-12 10:45:54 +1000
commitb4a0363d1721b2ad2d5afb65764ecb575bd55fa4 (patch)
treef6ec316550cd113040e82a7f0cee0429fff349e5 /common/list.c
parent146cc0a441f6901eeba7df691098f71d0de73a53 (diff)
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),
return -1;
}
+int list_find(list_t *list, void *item) {
+ for (int i = 0; i < list->length; i++) {
+ if (list->items[i] == item) {
+ return i;
+ }
+ }
+ return -1;
+}
+
void list_swap(list_t *list, int src, int dest) {
void *tmp = list->items[src];
list->items[src] = list->items[dest];