diff --git a/meson.build b/meson.build index c551bad452e..9471276131c 100644 --- a/meson.build +++ b/meson.build @@ -2020,6 +2020,12 @@ if with_platform_wayland dependencies: dep_wayland_client) pre_args += ['-DHAVE_WL_DISPATCH_QUEUE_TIMEOUT'] endif + if cc.has_function( + 'wl_display_create_queue_with_name', + prefix : '#include ', + dependencies: dep_wayland_client) + pre_args += ['-DHAVE_WL_CREATE_QUEUE_WITH_NAME'] + endif endif dep_x11 = null_dep diff --git a/src/loader/loader_wayland_helper.c b/src/loader/loader_wayland_helper.c index c25d787b68b..ffbbca83658 100644 --- a/src/loader/loader_wayland_helper.c +++ b/src/loader/loader_wayland_helper.c @@ -133,3 +133,11 @@ wl_display_dispatch_queue_timeout(struct wl_display *display, return ret; } #endif + +#ifndef HAVE_WL_CREATE_QUEUE_WITH_NAME +struct wl_event_queue * +wl_display_create_queue_with_name(struct wl_display *display, const char *name) +{ + return wl_display_create_queue(display); +} +#endif diff --git a/src/loader/loader_wayland_helper.h b/src/loader/loader_wayland_helper.h index ecd01e6d45a..56f47e31858 100644 --- a/src/loader/loader_wayland_helper.h +++ b/src/loader/loader_wayland_helper.h @@ -23,9 +23,10 @@ #ifndef LOADER_WAYLAND_HELPER_HEADER_H #define LOADER_WAYLAND_HELPER_HEADER_H +#include + #ifndef HAVE_WL_DISPATCH_QUEUE_TIMEOUT -#include #include int wl_display_dispatch_queue_timeout(struct wl_display *display, @@ -33,4 +34,10 @@ wl_display_dispatch_queue_timeout(struct wl_display *display, const struct timespec *deadline); #endif +#ifndef HAVE_WL_CREATE_QUEUE_WITH_NAME +struct wl_event_queue * +wl_display_create_queue_with_name(struct wl_display *display, + const char *name); +#endif + #endif