Turns out weston doesn't install xwayland-api header if Xwayland is not
installed, which is a shame, and should be rectified. Meanwhile, let's
guard access to the header and the API that the header exports.
Bug-AGL: SPEC-4782
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I77638b263483628f8cc7a3dcbd08c8947db1d86b
(cherry picked from commit
a68408367cf5e254d981e1d43ba261b9aade6166)
#include "shared/helpers.h"
#include <libweston/libweston.h>
#include <libweston-desktop/libweston-desktop.h>
#include "shared/helpers.h"
#include <libweston/libweston.h>
#include <libweston-desktop/libweston-desktop.h>
#include <libweston/xwayland-api.h>
#include <libweston/xwayland-api.h>
#include "agl-shell-desktop-server-protocol.h"
#include "agl-shell-desktop-server-protocol.h"
static void
transform_handler(struct wl_listener *listener, void *data)
{
static void
transform_handler(struct wl_listener *listener, void *data)
{
struct weston_surface *surface = data;
struct ivi_surface *ivisurf = get_ivi_shell_surface(surface);
const struct weston_xwayland_surface_api *api;
struct weston_surface *surface = data;
struct ivi_surface *ivisurf = get_ivi_shell_surface(surface);
const struct weston_xwayland_surface_api *api;
y = ivisurf->view->geometry.y;
api->send_position(surface, x, y);
y = ivisurf->view->geometry.y;
api->send_position(surface, x, y);
+#endif
+}
+
+bool
+is_shell_surface_xwayland(struct ivi_surface *surf)
+{
+#ifdef BUILD_XWAYLAND
+ const struct weston_xwayland_surface_api *api;
+ struct ivi_compositor *ivi = surf->ivi;
+ struct weston_surface *surface;
+
+ api = ivi->xwayland_surface_api;
+
+ if (!api)
+ return false;
+
+ surface = weston_desktop_surface_get_surface(surf->dsurface);
+ return api->is_xwayland_surface(surface);
+#else
+ return false;
+#endif