summaryrefslogtreecommitdiff
path: root/kiosk-shell
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman@collabora.com>2022-06-22 14:04:18 -0500
committerPekka Paalanen <pq@iki.fi>2022-06-29 11:44:48 +0000
commitd615abdffdb0b3f69c937c577cbd3855ed382a74 (patch)
treee87874002c9e82b523792062484e9126c6e7fa9b /kiosk-shell
parented97387a4ed7de217810f7ce708df142a10fc247 (diff)
downloadweston-d615abdffdb0b3f69c937c577cbd3855ed382a74.tar.gz
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 'kiosk-shell')
-rw-r--r--kiosk-shell/kiosk-shell.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kiosk-shell/kiosk-shell.c b/kiosk-shell/kiosk-shell.c
index 62949ed4..e13742fb 100644
--- a/kiosk-shell/kiosk-shell.c
+++ b/kiosk-shell/kiosk-shell.c
@@ -951,6 +951,17 @@ desktop_surface_set_xwayland_position(struct weston_desktop_surface *desktop_sur
shsurf->xwayland.is_set = true;
}
+static void
+desktop_surface_get_position(struct weston_desktop_surface *desktop_surface,
+ int32_t *x, int32_t *y, void *shell)
+{
+ struct kiosk_shell_surface *shsurf =
+ weston_desktop_surface_get_user_data(desktop_surface);
+
+ *x = shsurf->view->geometry.x;
+ *y = shsurf->view->geometry.y;
+}
+
static const struct weston_desktop_api kiosk_shell_desktop_api = {
.struct_size = sizeof(struct weston_desktop_api),
.surface_added = desktop_surface_added,
@@ -965,6 +976,7 @@ static const struct weston_desktop_api kiosk_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,
};
/*