Commits on Source (7)
-
The following patchset implements proper z-order for xdg surfaces in the kiosk shell. For this it introduces to the kiosk shell the concept of a "surface tree": a list of kiosk shell surface structures having a common ancestor (in the xdg protocol sense). The design is based on the following assumptions that the kiosk shell currently makes: - A kiosk surface with no parent must be fullscreen. - If a parent is set on a kiosk surface, that surface is assigned the output of the root kiosk surface. This means that all kiosk surfaces in a surface tree will always have the same output. - There is no possibility to minimize a kiosk surface. With these in mind, the following design decisions were deemed convenient: - For every output, at most one surface tree list will be active. This means that, for a given output, only views belonging to surfaces of the same surface tree will be in the normal layer. Moreover, all such views will be in the normal layer if the surface tree list is active. - The z-order of surface trees (the weston views' relative placement in the normal layer) is determined by the placement of their corresponding kiosk surface in the surface tree list. Each kiosk shell surface begins its life as root of its own surface tree list. Whenever a parent is set on a surface, that surface is linked to the surface tree list of the root surface of the parent. If a parent kiosk shell surface is destroyed, its children will keep the link to the root surface's surface tree list. If the destroyed parent is also the root surface of the surface tree, each child is unlinked from this root and they become the root of a new surface tree. This commit introduces to the kiosk_shell_surface structure the fields 'surface_tree_list', representing the surface tree list to which the surface is linked at creation as its root, and 'surface_tree_link', the link to the surface tree list. Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
a1c3c099 -
This commit introduces to the kiosk shell output structure a pointer to a surface tree list. This pointer will reference the surface tree list currently active on the output. (Surface tree lists were introduced in the previous commit) Each output will have at most one active surface tree. A surface tree being active on an output means that all views for this output belonging to that surface tree, and only those views, are in the normal layer. kiosk_shell_output_set_active_surface_tree() sets the current active surface tree for the specified output, replacing the previous one. Set the new active surface tree when first mapping a surface Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
1077a8ed -
This commit adds code to maintain the correct order and linking of a surface in its surface tree list for when a new parent is being set on it. If the new parent is not NULL, the child might already belong to the same surface tree as the new parent's root, in which case no relinking is necessary. Check this by calling kiosk_shell_surface_is_surface_in_tree(shsurf, shroot), to see if 'shsurf' is in the surface tree list represented by 'shroot', where 'shroot' is the new parent's root surface. In case 'shsurf' doesn't belong to this surface tree, relink it there. If parent is NULL, 'shsurf' will become root of a new surface tree list. In this case 'shroot' is the root surface of shsurf's current surface tree list. Iterate through the surface tree list of this 'shroot' to relink all descendents of 'shsurf' into this new list and set it as the new active surface tree for the output. Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
beece021 -
Currently, the 'parent_destroy_listener' is being paired with 'destroy_signal'. The signal is emitted from kiosk_shell_surface_destroy(), which is the appropriate place to emit this general-purpose surface destruction signal. However, we need to inform the children of the surface destruction before finding the focus successor and activating it, that is, before calling find_focus_successor() and kiosk_shell_surface_activate(), which happen before kiosk_shell_surface_destroy(). Since there are currently other uses for 'destroy_signal' (e.g. in kiosk-shell-grab.c), don't mess with it and simply add a new 'parent_destroy_signal', placing its emition where we need it. Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
d53efc6c -
The function find_focus_successor() is called when destroying a surface to find a successor to the current focus. It, however, has the following issues: - Its first parameter is the weston layer from which to search for a successor. This is an unnecessary flexibility for our use, which only adds complexity to the user of the function by having to make a call for each layer. We know that we want to search for a successor first in the normal layer, and if that fails, then in the inactive layer. So we change the signature of find_focus_successor(), removing this first parameter. - It includes logic to decide whether to do the search or not: if the destroyed surface is different from the surface that currently has focus, and if their outputs are the same, then abort and don't do the search. This returns NULL to the calling function. The problem is that the function also returns NULL if it does the search and finds no successor. The distinction for the failing reason is lost, and the user of the function needs to add more logic to know the reason for failure. To simplify, we take the logic out of find_focus_successor() and inside the caller. - It returns the successor view, although it receives surfaces and the client has logic to retrieve the surface corresponding to the returned view. To simplify and maintain symmetry, we change the signature so that the function returns the surface corresponding to the successor view. Fixes: #738 Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
cc837eea -
If we have a successor view that comes from the inactive layer, this means that we have a change in the active surface tree, so call kiosk_shell_output_set_active_surface_tree() on the root of that view's kiosk surface. If we have no successors, just reset the current active surface tree. Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
5d5e8642 -
Replace previous logic when placing views in the weston layers upon surface activation with new one that takes into account the surface tree lists design from the previous commits. This commit is based on previous code by Alexandros Frantzis. Fixes: #680 Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
19539314