From 23e3a3285a66a396aded43e25b079a5ca1c6573d Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 22 Jun 2022 14:08:23 -0500 Subject: [PATCH] libweston-desktop: Add get_position Plumb the new weston_desktop_api_get_position() through to xwayland. Signed-off-by: Derek Foreman --- libweston/desktop/xwayland.c | 13 +++++++++++++ xwayland/xwayland-internal-interface.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/libweston/desktop/xwayland.c b/libweston/desktop/xwayland.c index 4e426b11..0b795648 100644 --- a/libweston/desktop/xwayland.c +++ b/libweston/desktop/xwayland.c @@ -413,6 +413,18 @@ set_pid(struct weston_desktop_xwayland_surface *surface, pid_t pid) weston_desktop_surface_set_pid(surface->surface, pid); } +static void +get_position(struct weston_desktop_xwayland_surface *surface, + int32_t *x, int32_t *y) +{ + if (!surface->surface) { + *x = 0; + *y = 0; + return; + } + weston_desktop_api_get_position(surface->desktop, surface->surface, x, y); +} + static const struct weston_desktop_xwayland_interface weston_desktop_xwayland_interface = { .create_surface = create_surface, .set_toplevel = set_toplevel, @@ -428,6 +440,7 @@ static const struct weston_desktop_xwayland_interface weston_desktop_xwayland_in .set_maximized = set_maximized, .set_minimized = set_minimized, .set_pid = set_pid, + .get_position = get_position, }; void diff --git a/xwayland/xwayland-internal-interface.h b/xwayland/xwayland-internal-interface.h index a97d13bc..0e732772 100644 --- a/xwayland/xwayland-internal-interface.h +++ b/xwayland/xwayland-internal-interface.h @@ -61,6 +61,9 @@ struct weston_desktop_xwayland_interface { void (*set_maximized)(struct weston_desktop_xwayland_surface *shsurf); void (*set_minimized)(struct weston_desktop_xwayland_surface *shsurf); void (*set_pid)(struct weston_desktop_xwayland_surface *shsurf, pid_t pid); + void (*get_position)(struct weston_desktop_xwayland_surface *surface, + int32_t *x, int32_t *y); + }; #endif