kiosk-shell: Use weston_coord for xwayland window position

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-02-08 10:43:05 -06:00 committed by Marius Vlad
parent 5fa3ef26c9
commit 0aae35bfc3
2 changed files with 8 additions and 9 deletions

View File

@ -940,14 +940,15 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
weston_shell_utils_center_on_output(shsurf->view,
shsurf->output);
} else {
struct weston_coord_global tmp;
struct weston_coord_surface offset;
struct weston_geometry geometry =
weston_desktop_surface_get_geometry(desktop_surface);
float x = shsurf->xwayland.x - geometry.x;
float y = shsurf->xwayland.y - geometry.y;
tmp.c = weston_coord(x, y);
weston_view_set_position(shsurf->view, tmp);
offset = weston_coord_surface(-geometry.x, -geometry.y,
shsurf->view->surface);
weston_view_set_position_with_offset(shsurf->view,
shsurf->xwayland.pos,
offset);
}
weston_view_update_transform(shsurf->view);
@ -1125,8 +1126,7 @@ desktop_surface_set_xwayland_position(struct weston_desktop_surface *desktop_sur
struct kiosk_shell_surface *shsurf =
weston_desktop_surface_get_user_data(desktop_surface);
shsurf->xwayland.x = x;
shsurf->xwayland.y = y;
shsurf->xwayland.pos.c = weston_coord(x, y);
shsurf->xwayland.is_set = true;
}

View File

@ -75,8 +75,7 @@ struct kiosk_shell_surface {
struct {
bool is_set;
int32_t x;
int32_t y;
struct weston_coord_global pos;
} xwayland;
bool appid_output_assigned;