summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Phan <phanquangminh217@gmail.com>2023-02-05 14:38:32 +0700
committerOlivier Fourdan <fourdan@gmail.com>2023-02-10 14:57:59 +0000
commitba644a64a415962956de72936d21b6527ee8cd57 (patch)
tree05c3bdc02dce3cd69a32302fa5de454bc0d6a8b4
parente196535abbf2ef4aa7c1eb0b4b9b67840032b88a (diff)
downloadxserver-ba644a64a415962956de72936d21b6527ee8cd57.tar.gz
xwayland/window: Do not double add window to damage list
The window might be retained in the damage list after `xwl_screen_post_damage` in certain conditions. This means we need to check if the window is already in the list to avoid adding the same window twice which will lead to list corruption resulting in server freeze in `xwl_screen_post_damage`. Signed-off-by: Minh Phan <phanquangminh217@gmail.com>
-rw-r--r--hw/xwayland/xwayland-window.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c
index d254eab4c..4363730fd 100644
--- a/hw/xwayland/xwayland-window.c
+++ b/hw/xwayland/xwayland-window.c
@@ -179,7 +179,8 @@ damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data)
}
#endif
- xorg_list_add(&xwl_window->link_damage, &xwl_screen->damage_window_list);
+ if (xorg_list_is_empty(&xwl_window->link_damage))
+ xorg_list_add(&xwl_window->link_damage, &xwl_screen->damage_window_list);
}
static void