diff options
author | Quentin Glidic <sardemff7+git@sardemff7.net> | 2016-09-13 10:05:58 +0200 |
---|---|---|
committer | Quentin Glidic <sardemff7+git@sardemff7.net> | 2016-09-14 10:07:43 +0200 |
commit | a56b053ee154fd8c5b6782fa120ddc045e4e0147 (patch) | |
tree | 72b43a1da763de373f6f6edbc16ffba70bb0678e | |
parent | 870f384d0eb364ba049a73f682cef981704c3385 (diff) |
libweston-desktop: Fix configure event for already well-sized surfaces
Even if the surface size is already correct, we need to store the
configured size in case some other state change triggers a configure
event.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
-rw-r--r-- | libweston-desktop/wl-shell.c | 4 | ||||
-rw-r--r-- | libweston-desktop/xdg-shell-v5.c | 8 | ||||
-rw-r--r-- | libweston-desktop/xdg-shell-v6.c | 8 |
3 files changed, 12 insertions, 8 deletions
diff --git a/libweston-desktop/wl-shell.c b/libweston-desktop/wl-shell.c index 74ce4731..ded69f73 100644 --- a/libweston-desktop/wl-shell.c +++ b/libweston-desktop/wl-shell.c @@ -67,8 +67,8 @@ weston_desktop_wl_shell_surface_set_size(struct weston_desktop_surface *dsurface struct weston_surface *wsurface = weston_desktop_surface_get_surface(surface->surface); - if (wsurface->width == width && wsurface->height == height) - return; + if ((wsurface->width == width && wsurface->height == height) || + (width == 0 && height == 0)) wl_shell_surface_send_configure(surface->resource, WL_SHELL_SURFACE_RESIZE_NONE, diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c index 83e5d309..14216b08 100644 --- a/libweston-desktop/xdg-shell-v5.c +++ b/libweston-desktop/xdg-shell-v5.c @@ -192,11 +192,13 @@ weston_desktop_xdg_surface_set_size(struct weston_desktop_surface *dsurface, struct weston_desktop_xdg_surface *surface = user_data; struct weston_surface *wsurface = weston_desktop_surface_get_surface(surface->surface); - if (wsurface->width == width && wsurface->height == height) - return; - surface->requested_size.width = width; surface->requested_size.height = height; + + if ((wsurface->width == width && wsurface->height == height) || + (width == 0 && height == 0)) + return; + weston_desktop_xdg_surface_schedule_configure(surface); } diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c index d4d0112e..2afce81a 100644 --- a/libweston-desktop/xdg-shell-v6.c +++ b/libweston-desktop/xdg-shell-v6.c @@ -607,11 +607,13 @@ weston_desktop_xdg_toplevel_set_size(struct weston_desktop_surface *dsurface, struct weston_surface *wsurface = weston_desktop_surface_get_surface(toplevel->base.desktop_surface); - if (wsurface->width == width && wsurface->height == height) - return; - toplevel->requested_size.width = width; toplevel->requested_size.height = height; + + if ((wsurface->width == width && wsurface->height == height) || + (width == 0 && height == 0)) + return; + weston_desktop_xdg_surface_schedule_configure(&toplevel->base); } |