mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-19 19:25:41 +02:00
bar/wayland: add support for new events in wl-output v4
* name() * description()
This commit is contained in:
parent
2a0a722c13
commit
56c4a1c751
1 changed files with 25 additions and 2 deletions
|
@ -495,12 +495,35 @@ output_scale(void *data, struct wl_output *wl_output, int32_t factor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(WL_OUTPUT_NAME_SINCE_VERSION)
|
||||||
|
static void
|
||||||
|
output_name(void *data, struct wl_output *wl_output, const char *name)
|
||||||
|
{
|
||||||
|
struct monitor *mon = data;
|
||||||
|
free(mon->name);
|
||||||
|
mon->name = name != NULL ? strdup(name) : NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(WL_OUTPUT_DESCRIPTION_SINCE_VERSION)
|
||||||
|
static void
|
||||||
|
output_description(void *data, struct wl_output *wl_output,
|
||||||
|
const char *description)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const struct wl_output_listener output_listener = {
|
static const struct wl_output_listener output_listener = {
|
||||||
.geometry = &output_geometry,
|
.geometry = &output_geometry,
|
||||||
.mode = &output_mode,
|
.mode = &output_mode,
|
||||||
.done = &output_done,
|
.done = &output_done,
|
||||||
.scale = &output_scale,
|
.scale = &output_scale,
|
||||||
|
#if defined(WL_OUTPUT_NAME_SINCE_VERSION)
|
||||||
|
.name = &output_name,
|
||||||
|
#endif
|
||||||
|
#if defined(WL_OUTPUT_DESCRIPTION_SINCE_VERSION)
|
||||||
|
.description = &output_description,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1431,7 +1454,7 @@ set_cursor(struct bar *_bar, const char *cursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
output_name(const struct bar *_bar)
|
bar_output_name(const struct bar *_bar)
|
||||||
{
|
{
|
||||||
const struct private *bar = _bar->private;
|
const struct private *bar = _bar->private;
|
||||||
const struct wayland_backend *backend = bar->backend.data;
|
const struct wayland_backend *backend = bar->backend.data;
|
||||||
|
@ -1446,5 +1469,5 @@ const struct backend wayland_backend_iface = {
|
||||||
.commit = &commit,
|
.commit = &commit,
|
||||||
.refresh = &refresh,
|
.refresh = &refresh,
|
||||||
.set_cursor = &set_cursor,
|
.set_cursor = &set_cursor,
|
||||||
.output_name = &output_name,
|
.output_name = &bar_output_name,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue