On 10/18/17 11:01 AM, Jonas Ådahl wrote:
On Wed, Oct 18, 2017 at 10:58:44AM +0200, Quentin Glidic wrote:
From: Quentin Glidic <[email protected]>
If a surface is in state A, and we just sent a configure for state B,
setting back state A would be ignored, because state B has not been
committed yet.
Now, we check against the latest configured state (which is current
state if configure list is empty).
Reported on wlroots https://github.com/swaywm/wlroots/pull/280
Signed-off-by: Quentin Glidic <[email protected]>
Reviewed-by: Jonas Ådahl <[email protected]>
Thanks, and pushed:
71ebc0525..efade28db master -> master
Cheers,
---
v2: Actually check against latest configure, as Jonas suggested
libweston-desktop/xdg-shell-v6.c | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
index d82a507fa..4db3748b7 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -903,20 +903,39 @@ weston_desktop_xdg_surface_send_configure(void *user_data)
static bool
weston_desktop_xdg_toplevel_state_compare(struct weston_desktop_xdg_toplevel
*toplevel)
{
+ struct {
+ struct weston_desktop_xdg_toplevel_state state;
+ struct weston_size size;
+ } configured;
+
if (!toplevel->base.configured)
return false;
- if (toplevel->pending.state.activated != toplevel->current.state.activated)
+ if (wl_list_empty(&toplevel->base.configure_list)) {
+ /* Last configure is actually the current state, just use it */
+ configured.state = toplevel->current.state;
+ configured.size.width = toplevel->base.surface->width;
+ configured.size.height = toplevel->base.surface->height;
+ } else {
+ struct weston_desktop_xdg_toplevel_configure *configure =
+ wl_container_of(toplevel->base.configure_list.prev,
+ configure, base.link);
+
+ configured.state = configure->state;
+ configured.size = configure->size;
+ }
+
+ if (toplevel->pending.state.activated != configured.state.activated)
return false;
- if (toplevel->pending.state.fullscreen !=
toplevel->current.state.fullscreen)
+ if (toplevel->pending.state.fullscreen != configured.state.fullscreen)
return false;
- if (toplevel->pending.state.maximized !=
toplevel->current.state.maximized)
+ if (toplevel->pending.state.maximized != configured.state.maximized)
return false;
- if (toplevel->pending.state.resizing !=
toplevel->current.state.resizing)
+ if (toplevel->pending.state.resizing != configured.state.resizing)
return false;
- if (toplevel->base.surface->width == toplevel->pending.size.width &&
- toplevel->base.surface->height == toplevel->pending.size.height)
+ if (toplevel->pending.size.width == configured.size.width &&
+ toplevel->pending.size.height == configured.size.height)
return true;
if (toplevel->pending.size.width == 0 &&
--
2.13.4
_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel
--
Quentin “Sardem FF7” Glidic
_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel