bar: add bar->output_name(), returns the name of the output we’re on

This commit is contained in:
Daniel Eklöf 2021-08-02 19:29:52 +02:00
parent 96a35e5304
commit 74016d7d33
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 29 additions and 0 deletions

View file

@ -162,6 +162,13 @@ set_cursor(struct bar *bar, const char *cursor)
b->backend.iface->set_cursor(bar, cursor);
}
static const char *
output_name(const struct bar *bar)
{
const struct private *b = bar->private;
return b->backend.iface->output_name(bar);
}
static void
on_mouse(struct bar *_bar, enum mouse_event event, enum mouse_button btn,
int x, int y)
@ -456,6 +463,7 @@ bar_new(const struct bar_config *config)
bar->destroy = &destroy;
bar->refresh = &refresh;
bar->set_cursor = &set_cursor;
bar->output_name = &output_name;
for (size_t i = 0; i < priv->left.count; i++)
priv->left.mods[i]->bar = bar;