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>
This commit is contained in:
@@ -67,8 +67,8 @@ weston_desktop_wl_shell_surface_set_size(struct weston_desktop_surface *dsurface
|
|||||||
struct weston_surface *wsurface =
|
struct weston_surface *wsurface =
|
||||||
weston_desktop_surface_get_surface(surface->surface);
|
weston_desktop_surface_get_surface(surface->surface);
|
||||||
|
|
||||||
if (wsurface->width == width && wsurface->height == height)
|
if ((wsurface->width == width && wsurface->height == height) ||
|
||||||
return;
|
(width == 0 && height == 0))
|
||||||
|
|
||||||
wl_shell_surface_send_configure(surface->resource,
|
wl_shell_surface_send_configure(surface->resource,
|
||||||
WL_SHELL_SURFACE_RESIZE_NONE,
|
WL_SHELL_SURFACE_RESIZE_NONE,
|
||||||
|
|||||||
@@ -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_desktop_xdg_surface *surface = user_data;
|
||||||
struct weston_surface *wsurface = weston_desktop_surface_get_surface(surface->surface);
|
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.width = width;
|
||||||
surface->requested_size.height = height;
|
surface->requested_size.height = height;
|
||||||
|
|
||||||
|
if ((wsurface->width == width && wsurface->height == height) ||
|
||||||
|
(width == 0 && height == 0))
|
||||||
|
return;
|
||||||
|
|
||||||
weston_desktop_xdg_surface_schedule_configure(surface);
|
weston_desktop_xdg_surface_schedule_configure(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -607,11 +607,13 @@ weston_desktop_xdg_toplevel_set_size(struct weston_desktop_surface *dsurface,
|
|||||||
struct weston_surface *wsurface =
|
struct weston_surface *wsurface =
|
||||||
weston_desktop_surface_get_surface(toplevel->base.desktop_surface);
|
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.width = width;
|
||||||
toplevel->requested_size.height = height;
|
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);
|
weston_desktop_xdg_surface_schedule_configure(&toplevel->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user