diff options
author | Derek Foreman <derek.foreman@collabora.com> | 2022-06-22 14:04:18 -0500 |
---|---|---|
committer | Pekka Paalanen <pq@iki.fi> | 2022-06-29 11:44:48 +0000 |
commit | d615abdffdb0b3f69c937c577cbd3855ed382a74 (patch) | |
tree | e87874002c9e82b523792062484e9126c6e7fa9b /desktop-shell | |
parent | ed97387a4ed7de217810f7ce708df142a10fc247 (diff) |
shells: Add libweston-desktop API to query position and add to shells
We're going to need this to properly send xwayland events later, so add
API to get the current x,y co-ordinates of a shell surface and add it to
the kiosk and desktop shells.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r-- | desktop-shell/shell.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index c5afd8e1..9ebc9550 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2451,6 +2451,17 @@ desktop_surface_set_xwayland_position(struct weston_desktop_surface *surface, shsurf->xwayland.is_set = true; } +static void +desktop_surface_get_position(struct weston_desktop_surface *surface, + int32_t *x, int32_t *y, + void *shell_) +{ + struct shell_surface *shsurf = weston_desktop_surface_get_user_data(surface); + + *x = shsurf->view->geometry.x; + *y = shsurf->view->geometry.y; +} + static const struct weston_desktop_api shell_desktop_api = { .struct_size = sizeof(struct weston_desktop_api), .surface_added = desktop_surface_added, @@ -2465,6 +2476,7 @@ static const struct weston_desktop_api shell_desktop_api = { .ping_timeout = desktop_surface_ping_timeout, .pong = desktop_surface_pong, .set_xwayland_position = desktop_surface_set_xwayland_position, + .get_position = desktop_surface_get_position, }; /* ************************ * |