@ -650,12 +650,18 @@ find_focus_successor(struct weston_layer *layer,
struct weston_view * top_view = NULL ;
struct weston_view * top_view = NULL ;
struct weston_view * view ;
struct weston_view * view ;
/* we need to take into account that the surface being destroyed it not
/* we need to take into account that the surface being destroyed it not
* always the same as the focus_surface , which could result in picking
* always the same as the focus_surface , which could result in picking
* and * activating * the wrong window , so avoid returning a view for
* and * activating * the wrong window , so avoid returning a view for
* that case . A particular case is when a top - level child window , would
* that case . A particular case is when a top - level child window , would
* pick a parent window below the focused_surface . */
* pick a parent window below the focused_surface .
if ( focused_surface ! = shsurf - > view - > surface )
*
* Apply that only on the same output to avoid incorrectly returning an
* invalid / empty view , which could happen if the view being destroyed
* is on a output different than the focused_surface output */
if ( focused_surface & & focused_surface ! = shsurf - > view - > surface & &
shsurf - > output = = focused_surface - > output )
return top_view ;
return top_view ;
wl_list_for_each ( view , & layer - > view_list . link , layer_link . link ) {
wl_list_for_each ( view , & layer - > view_list . link , layer_link . link ) {
@ -665,6 +671,10 @@ find_focus_successor(struct weston_layer *layer,
if ( ! view - > is_mapped | | view = = shsurf - > view )
if ( ! view - > is_mapped | | view = = shsurf - > view )
continue ;
continue ;
/* pick views only on the same output */
if ( view - > output ! = shsurf - > output )
continue ;
view_shsurf = get_kiosk_shell_surface ( view - > surface ) ;
view_shsurf = get_kiosk_shell_surface ( view - > surface ) ;
if ( ! view_shsurf )
if ( ! view_shsurf )
continue ;
continue ;