Commit c06f85fa authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

phosh: Fix crash when an unmapped surface is selected when switching

Unmapped surfaces have no app_id and no title, so comparisons are not possible.
parent 88a23a99
......@@ -70,14 +70,16 @@ static void xdg_switcher_handle_raise_xdg_surfaces(struct wl_client *client,
wl_list_for_each(view, &desktop->views, link) {
switch (view->type) {
case ROOTS_XDG_SHELL_VIEW:
if (view->xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL)
if (view->xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL
|| !view->xdg_surface->mapped)
continue;
if (!strcmp(app_id, view->xdg_surface->toplevel->app_id) &&
!strcmp(title, view->xdg_surface->toplevel->title))
found_view = view;
break;
case ROOTS_XDG_SHELL_V6_VIEW:
if (view->xdg_surface_v6->role != WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL)
if (view->xdg_surface_v6->role != WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL
|| !view->xdg_surface_v6->mapped)
continue;
if (!strcmp(app_id, view->xdg_surface_v6->toplevel->app_id) &&
!strcmp(title, view->xdg_surface_v6->toplevel->title))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment