From e3715527b99dd7ccf30d06002555b8102a02d7d1 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 26 Jul 2017 14:35:58 -0500 Subject: [PATCH] libweston-desktop/xdg-shell: Properly properly handle ack_configure commit 749637a8a306588964885fe6b25fda6087a84ccd introduced this feature, but the break is outside of any conditional so only the first item in the list is ever tested. If a client skips a few configures and then acks the most recent it's still operating within spec, so the break should only occur when a match is found. This version also adds a break after we miss the target, as a tiny optimization (the list will be cleaned up on disconnect anyway), as it makes the code no more difficult to read or maintain. Signed-off-by: Derek Foreman Reviewed-by: Quentin Glidic --- libweston-desktop/xdg-shell-v5.c | 4 +++- libweston-desktop/xdg-shell-v6.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c index 77d004e1..dd360862 100644 --- a/libweston-desktop/xdg-shell-v5.c +++ b/libweston-desktop/xdg-shell-v5.c @@ -481,8 +481,10 @@ weston_desktop_xdg_surface_protocol_ack_configure(struct wl_client *wl_client, } else if (configure->serial == serial) { wl_list_remove(&configure->link); found = true; + break; + } else { + break; } - break; } if (!found) { struct weston_desktop_client *client = diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c index 1344dda0..10274e07 100644 --- a/libweston-desktop/xdg-shell-v6.c +++ b/libweston-desktop/xdg-shell-v6.c @@ -1106,8 +1106,10 @@ weston_desktop_xdg_surface_protocol_ack_configure(struct wl_client *wl_client, } else if (configure->serial == serial) { wl_list_remove(&configure->link); found = true; + break; + } else { + break; } - break; } if (!found) { struct weston_desktop_client *client =