summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergio Gómez <sergio.g.delreal@gmail.com>2023-07-19 21:46:20 -0500
committerMarius Vlad <marius.vlad@collabora.com>2023-07-27 10:13:48 +0300
commitcc837eea61f54c3a08d416fdbf17fcc3a8a994fb (patch)
tree4b5aa9d78e17faa36744270d05672a69501ab0cc /include
parentd53efc6cc3f718dd538cd50a24cf4c5bb95f0c96 (diff)
kiosk-shell: Redesign the function 'find_focus_successor()'
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>
Diffstat (limited to 'include')
-rw-r--r--include/libweston/libweston.h3
-rw-r--r--include/libweston/shell-utils.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h
index f4641c44..626a5bee 100644
--- a/include/libweston/libweston.h
+++ b/include/libweston/libweston.h
@@ -1221,6 +1221,9 @@ struct weston_layer_entry {
* at their discretion.
*/
enum weston_layer_position {
+ /* Special value to indicate an invalid layer position. */
+ WESTON_LAYER_POSITION_NONE = -1,
+
/*
* Special value to make the layer invisible and still rendered.
* This is used by compositors wanting e.g. minimized surfaces to still
diff --git a/include/libweston/shell-utils.h b/include/libweston/shell-utils.h
index 988e1e82..0a3c4185 100644
--- a/include/libweston/shell-utils.h
+++ b/include/libweston/shell-utils.h
@@ -73,6 +73,9 @@ weston_shell_utils_curtain_create(struct weston_compositor *compositor,
void
weston_shell_utils_curtain_destroy(struct weston_curtain *curtain);
+enum weston_layer_position
+weston_shell_utils_view_get_layer_position(struct weston_view *view);
+
#ifdef __cplusplus
}
#endif