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