cmd_output: Use list_seq_find() to find matching config

This commit is contained in:
Christoph Gysin 2015-11-29 14:51:42 +02:00
parent 88f372a22a
commit 7d82cd9c0a
3 changed files with 14 additions and 7 deletions

View file

@ -261,6 +261,14 @@ bool read_config(FILE *file, bool is_active) {
return success;
}
int output_name_cmp(const void *item, const void *data)
{
const struct output_config *output = item;
const char *name = data;
return strcmp(output->name, name);
}
void apply_output_config(struct output_config *oc, swayc_t *output) {
if (oc && oc->width > 0 && oc->height > 0) {
output->width = oc->width;