mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-01 01:40:36 -05:00
view: adjust position according to declared top left corner
The XDG surface geometry includes an (x,y) coordinate indicating the top left corner of the window. Use this information to correctly set the view position.
This commit is contained in:
parent
6f20285555
commit
e8c038cc8a
4 changed files with 26 additions and 18 deletions
|
|
@ -125,13 +125,12 @@ get_title(struct cg_view *view)
|
|||
}
|
||||
|
||||
static void
|
||||
get_geometry(struct cg_view *view, int *width_out, int *height_out)
|
||||
get_geometry(struct cg_view *view, struct wlr_box *view_box)
|
||||
{
|
||||
struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view);
|
||||
struct wlr_xdg_surface *xdg_surface = xdg_shell_view->xdg_toplevel->base;
|
||||
|
||||
*width_out = xdg_surface->geometry.width;
|
||||
*height_out = xdg_surface->geometry.height;
|
||||
memcpy(view_box, &xdg_surface->geometry, sizeof(*view_box));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue