mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 14:18:32 +02:00
libweston-desktop: Fix weston crash when lost the shsurf
The shell_surface may disappear when keyboard lost focus,
then the shsurf will be NULL.
Have an ahead check for shsurf before calling the callback
in weston_desktop_surface_foreach_child.
Fixes #811
Tested-by: Erkai Ji <erkai.ji@nxp.com>
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit 042d02f422)
This commit is contained in:
parent
0d139480d3
commit
818d76649a
1 changed files with 4 additions and 2 deletions
|
|
@ -888,6 +888,8 @@ weston_desktop_surface_foreach_child(struct weston_desktop_surface *surface,
|
|||
{
|
||||
struct weston_desktop_surface *child;
|
||||
|
||||
wl_list_for_each(child, &surface->children_list, children_link)
|
||||
callback(child, user_data);
|
||||
wl_list_for_each(child, &surface->children_list, children_link) {
|
||||
if (weston_desktop_surface_get_user_data(child))
|
||||
callback(child, user_data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue