diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-04-03 15:20:00 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-05-12 18:30:23 +0000 |
commit | 5ce0b5d5200f8d5e21e15981b0179fd429ee836d (patch) | |
tree | 97c485426498e7d9f918c11335fb87df180b8993 /src/layout.c | |
parent | ab151e5d3d10f85901c0a9b689ef62e83c7dbc5e (diff) |
layout, desktop: Implement the pop-up role
Temporally store the application details in a list of pending
applications as to be used when creating the desktop surface. Store the
output alongside the x and y values, useful in setting up the initial
positional values of the window.
Bug-AGL: SPEC-3269
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Icae57378ff405a8770c074a3e2fe1e04535302ef
Diffstat (limited to 'src/layout.c')
-rw-r--r-- | src/layout.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/layout.c b/src/layout.c index 9537034..ff30def 100644 --- a/src/layout.c +++ b/src/layout.c @@ -282,6 +282,44 @@ skip_config_check: } void +ivi_layout_popup_committed(struct ivi_surface *surface) +{ + struct ivi_compositor *ivi = surface->ivi; + + struct weston_desktop_surface *dsurface = surface->dsurface; + struct weston_surface *wsurface = + weston_desktop_surface_get_surface(dsurface); + + struct ivi_output *output = surface->popup.output; + struct weston_output *woutput = output->output; + + struct weston_view *view = surface->view; + struct weston_geometry geom; + + if (surface->view->is_mapped) + return; + + geom = weston_desktop_surface_get_geometry(dsurface); + weston_log("geom x %d, y %d, width %d, height %d\n", geom.x, geom.y, + geom.width, geom.height); + + assert(surface->role == IVI_SURFACE_ROLE_POPUP); + + weston_view_set_output(view, woutput); + if (surface->popup.x || surface->popup.y) + weston_view_set_position(view, surface->popup.x, surface->popup.y); + else + weston_view_set_position(view, geom.x, geom.y); + weston_layer_entry_insert(&ivi->popup.view_list, &view->layer_link); + + weston_view_update_transform(view); + weston_view_schedule_repaint(view); + + wsurface->is_mapped = true; + surface->view->is_mapped = true; +} + +void ivi_layout_panel_committed(struct ivi_surface *surface) { struct ivi_compositor *ivi = surface->ivi; |