kiosk-shell: Use weston_coord for xwayland window position
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
5fa3ef26c9
commit
0aae35bfc3
|
@ -940,14 +940,15 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
|
||||||
weston_shell_utils_center_on_output(shsurf->view,
|
weston_shell_utils_center_on_output(shsurf->view,
|
||||||
shsurf->output);
|
shsurf->output);
|
||||||
} else {
|
} else {
|
||||||
struct weston_coord_global tmp;
|
struct weston_coord_surface offset;
|
||||||
struct weston_geometry geometry =
|
struct weston_geometry geometry =
|
||||||
weston_desktop_surface_get_geometry(desktop_surface);
|
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);
|
offset = weston_coord_surface(-geometry.x, -geometry.y,
|
||||||
weston_view_set_position(shsurf->view, tmp);
|
shsurf->view->surface);
|
||||||
|
weston_view_set_position_with_offset(shsurf->view,
|
||||||
|
shsurf->xwayland.pos,
|
||||||
|
offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
weston_view_update_transform(shsurf->view);
|
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 =
|
struct kiosk_shell_surface *shsurf =
|
||||||
weston_desktop_surface_get_user_data(desktop_surface);
|
weston_desktop_surface_get_user_data(desktop_surface);
|
||||||
|
|
||||||
shsurf->xwayland.x = x;
|
shsurf->xwayland.pos.c = weston_coord(x, y);
|
||||||
shsurf->xwayland.y = y;
|
|
||||||
shsurf->xwayland.is_set = true;
|
shsurf->xwayland.is_set = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,8 +75,7 @@ struct kiosk_shell_surface {
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
bool is_set;
|
bool is_set;
|
||||||
int32_t x;
|
struct weston_coord_global pos;
|
||||||
int32_t y;
|
|
||||||
} xwayland;
|
} xwayland;
|
||||||
|
|
||||||
bool appid_output_assigned;
|
bool appid_output_assigned;
|
||||||
|
|
Loading…
Reference in New Issue