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 <daniels@collabora.com>
dev
Daniel Stone 3 years ago
parent 577a832f41
commit b94d69b926
  1. 36
      fullscreen-shell/fullscreen-shell.c
  2. 3
      fullscreen-shell/meson.build

@ -37,6 +37,7 @@
#include "compositor/weston.h" #include "compositor/weston.h"
#include "fullscreen-shell-unstable-v1-server-protocol.h" #include "fullscreen-shell-unstable-v1-server-protocol.h"
#include "shared/helpers.h" #include "shared/helpers.h"
#include "shell-utils.h"
struct fullscreen_shell { struct fullscreen_shell {
struct wl_client *client; struct wl_client *client;
@ -373,41 +374,6 @@ restore_output_mode(struct weston_output *output)
weston_output_mode_switch_to_native(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(&region, 0, 0,
surface->width,
surface->height);
wl_list_for_each(subsurface, &surface->subsurface_list, parent_link) {
pixman_region32_union_rect(&region, &region,
subsurface->position.x,
subsurface->position.y,
subsurface->surface->width,
subsurface->surface->height);
}
box = pixman_region32_extents(&region);
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(&region);
}
static void static void
fs_output_center_view(struct fs_output *fsout) fs_output_center_view(struct fs_output *fsout)
{ {

@ -4,9 +4,10 @@ if get_option('shell-fullscreen')
fullscreen_shell_unstable_v1_server_protocol_h, fullscreen_shell_unstable_v1_server_protocol_h,
fullscreen_shell_unstable_v1_protocol_c, fullscreen_shell_unstable_v1_protocol_c,
] ]
deps_shell_fullscreen=[ deps_shell_fullscreen = [
dep_libweston_public, dep_libweston_public,
dep_libexec_weston, dep_libexec_weston,
dep_shell_utils,
] ]
shared_library( shared_library(
'fullscreen-shell', 'fullscreen-shell',

Loading…
Cancel
Save