summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-07-26 14:35:58 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-07-27 12:00:06 -0500
commite3715527b99dd7ccf30d06002555b8102a02d7d1 (patch)
tree9dcb95992f31709a6b6ef0d9d5e8e7e727f754d7
parent0e4e570caee9f857d13e35a9f4c78d52343872d7 (diff)
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 <derekf@osg.samsung.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
-rw-r--r--libweston-desktop/xdg-shell-v5.c4
-rw-r--r--libweston-desktop/xdg-shell-v6.c4
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 =