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>
This commit is contained in:
committed by
Pekka Paalanen
parent
ed97387a4e
commit
d615abdffd
@@ -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,
|
||||
};
|
||||
|
||||
/* ************************ *
|
||||
|
||||
Reference in New Issue
Block a user