Added --window-image option to swaylock

This allows setting window specific images.

Also Changed:
  - The colored background is _always_ drawn, to prevent non-fullscreen
    images from leaking information.
  - Added function list_arbitrary_insert, which allows insertion to a
    list at an arbitrary location less than the capacity. It silently
    fails otherwise.
This commit is contained in:
Nuew 2016-03-22 01:20:11 -04:00
parent 4ce1ab8a26
commit 1ca5453678
3 changed files with 108 additions and 33 deletions

View file

@ -47,6 +47,14 @@ void list_insert(list_t *list, int index, void *item) {
list->items[index] = item;
}
// Added because IDK if it's safe to remove that memmove
void list_arbitrary_insert(list_t *list, int index, void *item) {
list_resize(list);
if(index > list->capacity) return;
if(list->length < index) list->length = index;
list->items[index] = item;
}
void list_del(list_t *list, int index) {
list->length--;
memmove(&list->items[index], &list->items[index + 1], sizeof(void*) * (list->length - index));