meson: add xdg-activation-v1.xml conditionally

Only enable XDG activation when compiling against wayland-protocols
1.21. Older versions don’t have this protocol.

When available, define HAVE_XDG_ACTIVATION.

Make all usages of xdg_activation_v1 and xdg_activation_token_v1
conditional.
This commit is contained in:
Daniel Eklöf 2021-05-11 17:58:40 +02:00
parent bf44f3f594
commit 03e1b906ab
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 31 additions and 3 deletions

View file

@ -12,11 +12,14 @@
#include <presentation-time.h>
#include <primary-selection-unstable-v1.h>
#include <text-input-unstable-v3.h>
#include <xdg-activation-v1.h>
#include <xdg-decoration-unstable-v1.h>
#include <xdg-output-unstable-v1.h>
#include <xdg-shell.h>
#if defined(HAVE_XDG_ACTIVATION)
#include <xdg-activation-v1.h>
#endif
#include <tllist.h>
#include "fdm.h"
@ -383,7 +386,9 @@ struct wl_window {
struct wl_surface *surface;
struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
#if defined(HAVE_XDG_ACTIVATION)
struct xdg_activation_token_v1 *xdg_activation_token;
#endif
struct zxdg_toplevel_decoration_v1 *xdg_toplevel_decoration;
@ -451,7 +456,9 @@ struct wayland {
struct wl_data_device_manager *data_device_manager;
struct zwp_primary_selection_device_manager_v1 *primary_selection_device_manager;
#if defined(HAVE_XDG_ACTIVATION)
struct xdg_activation_v1 *xdg_activation;
#endif
struct wp_presentation *presentation;
uint32_t presentation_clock_id;