diff options
author | 2022-04-27 15:44:58 +0300 | |
---|---|---|
committer | 2022-05-03 06:56:40 +0000 | |
commit | 13ac8bab43fffd002196d3a6760eefaa8944def2 (patch) | |
tree | cfb2c7b11eb423b4fb8724fa6609c2035903c6c2 /src/layout.c | |
parent | 2cd345013ccaaccd74e61e6a14546bc861f8b5b1 (diff) |
layout: Send dimensions when setting up property as fullscreen
Instead of doing it at commit time, do it right after getting the xdg
toplevel surface such that clients can use it from the beginning.
This now includes fullscreen, besides regular desktop roles, and it
avoid mapping the fullscreen upon commit if the dimensions do not really
match up.
Bug-AGL: SPEC-4339
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I7185b10770c69d1d6572b0bc025c4a58fe431c67
Diffstat (limited to 'src/layout.c')
-rw-r--r-- | src/layout.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/layout.c b/src/layout.c index daffd5e..70cc837 100644 --- a/src/layout.c +++ b/src/layout.c @@ -256,8 +256,7 @@ ivi_layout_find_with_app_id(const char *app_id, struct ivi_compositor *ivi) return NULL; } - -static struct ivi_output * +struct ivi_output * ivi_layout_find_bg_output(struct ivi_compositor *ivi) { struct ivi_output *out; @@ -403,6 +402,7 @@ ivi_layout_fullscreen_committed(struct ivi_surface *surface) struct ivi_output *output = surface->split.output; struct weston_output *woutput = output->output; + struct ivi_output *bg_output = ivi_layout_find_bg_output(ivi); struct weston_view *view = surface->view; struct weston_geometry geom; @@ -416,12 +416,19 @@ ivi_layout_fullscreen_committed(struct ivi_surface *surface) return; geom = weston_desktop_surface_get_geometry(dsurface); - weston_log("(fs) geom x %d, y %d, width %d, height %d\n", geom.x, geom.y, - geom.width, geom.height); - assert(surface->role == IVI_SURFACE_ROLE_FULLSCREEN); - weston_desktop_surface_set_fullscreen(dsurface, true); + if (!weston_desktop_surface_get_fullscreen(dsurface) || + geom.width != bg_output->output->width || + geom.height != bg_output->output->height) { + struct weston_desktop_client *desktop_client = + weston_desktop_surface_get_client(dsurface); + struct wl_client *client = + weston_desktop_client_get_client(desktop_client); + wl_client_post_implementation_error(client, + "Can not display surface due to invalid geometry"); + return; + } weston_view_set_output(view, woutput); weston_view_set_position(view, woutput->x, woutput->y); |