Skip to content

Commit

Permalink
fix shell crash with android studio 4.2 (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: Hideyuki Nagase <hideyukn@ntdev.microsoft.com>
  • Loading branch information
hideyukn88 and Hideyuki Nagase committed May 11, 2021
1 parent 0af13ff commit 6892454
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
7 changes: 5 additions & 2 deletions desktop-shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -2780,8 +2780,11 @@ desktop_surface_set_parent(struct weston_desktop_surface *desktop_surface,

if (parent) {
shsurf_parent = weston_desktop_surface_get_user_data(parent);
wl_list_insert(shsurf_parent->children_list.prev,
&shsurf->children_link);
if (shsurf_parent)
wl_list_insert(shsurf_parent->children_list.prev,
&shsurf->children_link);
else
wl_list_init(&shsurf->children_link);
} else {
wl_list_init(&shsurf->children_link);
}
Expand Down
22 changes: 14 additions & 8 deletions rdprail-shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -2427,14 +2427,20 @@ desktop_surface_set_parent(struct weston_desktop_surface *desktop_surface,

if (parent) {
shsurf_parent = weston_desktop_surface_get_user_data(parent);
wl_list_insert(shsurf_parent->children_list.prev,
&shsurf->children_link);
/* libweston-desktop doesn't establish parent/child relationship
with weston_desktop_api shell_desktop_api.set_parent call,
thus calling weston_desktop_surface_get_parent won't work,
so shell need to track by itself. This also means child's
geometry won't be adjusted to relative to parent. */
shsurf->parent = shsurf_parent;
if (shsurf_parent) {
wl_list_insert(shsurf_parent->children_list.prev,
&shsurf->children_link);
/* libweston-desktop doesn't establish parent/child relationship
with weston_desktop_api shell_desktop_api.set_parent call,
thus calling weston_desktop_surface_get_parent won't work,
so shell need to track by itself. This also means child's
geometry won't be adjusted to relative to parent. */
shsurf->parent = shsurf_parent;
} else {
weston_log("RDP shell: parent is not toplevel surface\n");
wl_list_init(&shsurf->children_link);
shsurf->parent = NULL;
}
} else {
wl_list_init(&shsurf->children_link);
shsurf->parent = NULL;
Expand Down

0 comments on commit 6892454

Please sign in to comment.