From b94d69b926f060a48a4ba070c4b416aa9a15e90b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 23 Feb 2022 13:31:26 +0000 Subject: [PATCH] fullscreen-shell: Link with shell-utils helpers Unlike desktop-shell and kiosk-shell, the fullscreen-shell does not link with the common shell-utils helpers. This is largely because fullscreen-shell is largely in 'maintenance mode', seeing little more than occasional bug fixes or changes required to accommodate new interfaces. This commit adds a dependency from fullscreen-shell to use the shell-utils helper, in order to allow fullscreen-shell to use the new weston_curtain infrastructure, rather than continuing to open-code the common pattern of creating a surface and view consisting only of a solid colour for the background of fullscreen surfaces which do not wholly cover the output. In doing this, the 'surface_subsurfaces_boundingbox()' function is removed, as this has been duplicated between the fullscreen-shell and the common helper 'library'. There is no functional change within this commit, as the two functions were identical, other than a change to the comment which identifies a known bug within this helper. Signed-off-by: Daniel Stone --- fullscreen-shell/fullscreen-shell.c | 36 +---------------------------- fullscreen-shell/meson.build | 3 ++- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/fullscreen-shell/fullscreen-shell.c b/fullscreen-shell/fullscreen-shell.c index 6975f65e..e122bf8a 100644 --- a/fullscreen-shell/fullscreen-shell.c +++ b/fullscreen-shell/fullscreen-shell.c @@ -37,6 +37,7 @@ #include "compositor/weston.h" #include "fullscreen-shell-unstable-v1-server-protocol.h" #include "shared/helpers.h" +#include "shell-utils.h" struct fullscreen_shell { struct wl_client *client; @@ -373,41 +374,6 @@ restore_output_mode(struct weston_output *output) weston_output_mode_switch_to_native(output); } -/* - * Returns the bounding box of a surface and all its sub-surfaces, - * in surface-local coordinates. */ -static void -surface_subsurfaces_boundingbox(struct weston_surface *surface, int32_t *x, - int32_t *y, int32_t *w, int32_t *h) { - pixman_region32_t region; - pixman_box32_t *box; - struct weston_subsurface *subsurface; - - pixman_region32_init_rect(®ion, 0, 0, - surface->width, - surface->height); - - wl_list_for_each(subsurface, &surface->subsurface_list, parent_link) { - pixman_region32_union_rect(®ion, ®ion, - subsurface->position.x, - subsurface->position.y, - subsurface->surface->width, - subsurface->surface->height); - } - - box = pixman_region32_extents(®ion); - if (x) - *x = box->x1; - if (y) - *y = box->y1; - if (w) - *w = box->x2 - box->x1; - if (h) - *h = box->y2 - box->y1; - - pixman_region32_fini(®ion); -} - static void fs_output_center_view(struct fs_output *fsout) { diff --git a/fullscreen-shell/meson.build b/fullscreen-shell/meson.build index 02a6c6f1..4ecac5bc 100644 --- a/fullscreen-shell/meson.build +++ b/fullscreen-shell/meson.build @@ -4,9 +4,10 @@ if get_option('shell-fullscreen') fullscreen_shell_unstable_v1_server_protocol_h, fullscreen_shell_unstable_v1_protocol_c, ] - deps_shell_fullscreen=[ + deps_shell_fullscreen = [ dep_libweston_public, dep_libexec_weston, + dep_shell_utils, ] shared_library( 'fullscreen-shell',