Add common/array.h with wl_array_len()

This commit is contained in:
Johan Malm 2023-08-20 11:56:50 +01:00 committed by Consolatis
parent 7fde7ed2cc
commit 602d59a3b2
2 changed files with 35 additions and 1 deletions

View file

@ -7,6 +7,7 @@
#include <wlr/util/log.h>
#include <wlr/util/box.h>
#include "buffer.h"
#include "common/array.h"
#include "common/buf.h"
#include "common/font.h"
#include "common/graphic-helpers.h"
@ -411,7 +412,7 @@ display_osd(struct output *output)
float scale = output->wlr_output->scale;
int w = theme->osd_window_switcher_width;
int h = views.size / sizeof(struct view *) * rc.theme->osd_window_switcher_item_height
int h = wl_array_len(&views) * rc.theme->osd_window_switcher_item_height
+ 2 * rc.theme->osd_border_width
+ 2 * rc.theme->osd_window_switcher_padding;
if (show_workspace) {