[PATCH] libweston-desktop/xdg-shell: Check window geometry instead of surface size against configured size
Quentin Glidic
sardemff7+wayland at sardemff7.net
Wed Jul 26 14:47:17 UTC 2017
Nit:
You should do "git config format.subjectprefix 'PATCH weston'" to your
repo, to keep patches linked to Weston.
On 7/26/17 2:02 PM, Philipp Kerling wrote:
> Shell surfaces may have a geometry that is different to the size of
> their main surface, e.g. due to subcompositing.
>
> In states where size is strictly enforced (fullscreen and maximized),
> the size that the compositor wants must be checked against the window
> geometry and not just the main surface size.
>
> Fix by calling weston_desktop_surface_get_geometry and using that size
> instead of main surface size.
>
> Signed-off-by: Philipp Kerling <pkerling at casix.org>
> ---
> libweston-desktop/xdg-shell-v5.c | 7 +++++--
> libweston-desktop/xdg-shell-v6.c | 7 +++++--
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c
> index d7c49b15..3f97cd23 100644
> --- a/libweston-desktop/xdg-shell-v5.c
> +++ b/libweston-desktop/xdg-shell-v5.c
> @@ -264,9 +264,12 @@ weston_desktop_xdg_surface_committed(struct weston_desktop_surface *dsurface,
> weston_desktop_surface_get_surface(surface->surface);
> bool reconfigure = false;
>
> + struct weston_geometry geometry =
> + weston_desktop_surface_get_geometry(surface->surface);
> +
> if (surface->next.state.maximized || surface->next.state.fullscreen)
> - reconfigure = surface->next.size.width != wsurface->width ||
> - surface->next.size.height != wsurface->height;
> + reconfigure = surface->next.size.width != geometry.width ||
> + surface->next.size.height != geometry.height;
>
Actually, there is more to do on this part, and we /might/ ditch v5
support on the next cycle, so I’ll replace this hunk with a TODO comment
and push it.
> if (reconfigure) {
> weston_desktop_xdg_surface_schedule_configure(surface, true);
> diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
> index dda0bf92..1344dda0 100644
> --- a/libweston-desktop/xdg-shell-v6.c
> +++ b/libweston-desktop/xdg-shell-v6.c
> @@ -644,9 +644,12 @@ weston_desktop_xdg_toplevel_committed(struct weston_desktop_xdg_toplevel *toplev
> if (!wsurface->buffer_ref.buffer)
> return;
>
> + struct weston_geometry geometry =
> + weston_desktop_surface_get_geometry(toplevel->base.desktop_surface);
> +
> if ((toplevel->next.state.maximized || toplevel->next.state.fullscreen) &&
> - (toplevel->next.size.width != wsurface->width ||
> - toplevel->next.size.height != wsurface->height)) {
> + (toplevel->next.size.width != geometry.width ||
> + toplevel->next.size.height != geometry.height)) {
> struct weston_desktop_client *client =
> weston_desktop_surface_get_client(toplevel->base.desktop_surface);
> struct wl_resource *client_resource =
So:
Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>
And pushed:
ba8a0d04..c623902e master -> master
Thanks,
--
Quentin “Sardem FF7” Glidic
More information about the wayland-devel
mailing list