@ -173,10 +173,12 @@ kiosk_shell_surface_find_best_output(struct kiosk_shell_surface *shsurf)
app_id = weston_desktop_surface_get_app_id ( shsurf - > desktop_surface ) ;
app_id = weston_desktop_surface_get_app_id ( shsurf - > desktop_surface ) ;
if ( app_id ) {
if ( app_id ) {
wl_list_for_each ( shoutput , & shsurf - > shell - > output_list , link ) {
wl_list_for_each ( shoutput , & shsurf - > shell - > output_list , link ) {
if ( kiosk_shell_output_has_app_id ( shoutput , app_id ) )
if ( kiosk_shell_output_has_app_id ( shoutput , app_id ) ) {
shsurf - > appid_output_assigned = true ;
return shoutput - > output ;
return shoutput - > output ;
}
}
}
}
}
/* Group all related windows in the same output. */
/* Group all related windows in the same output. */
root = kiosk_shell_surface_get_parent_root ( shsurf ) ;
root = kiosk_shell_surface_get_parent_root ( shsurf ) ;
@ -354,6 +356,7 @@ kiosk_shell_surface_create(struct kiosk_shell *shell,
shsurf - > desktop_surface = desktop_surface ;
shsurf - > desktop_surface = desktop_surface ;
shsurf - > view = view ;
shsurf - > view = view ;
shsurf - > shell = shell ;
shsurf - > shell = shell ;
shsurf - > appid_output_assigned = false ;
weston_desktop_surface_set_user_data ( desktop_surface , shsurf ) ;
weston_desktop_surface_set_user_data ( desktop_surface , shsurf ) ;
@ -721,6 +724,8 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
weston_desktop_surface_get_user_data ( desktop_surface ) ;
weston_desktop_surface_get_user_data ( desktop_surface ) ;
struct weston_surface * surface =
struct weston_surface * surface =
weston_desktop_surface_get_surface ( desktop_surface ) ;
weston_desktop_surface_get_surface ( desktop_surface ) ;
const char * app_id =
weston_desktop_surface_get_app_id ( desktop_surface ) ;
bool is_resized ;
bool is_resized ;
bool is_fullscreen ;
bool is_fullscreen ;
@ -729,6 +734,24 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
if ( surface - > width = = 0 )
if ( surface - > width = = 0 )
return ;
return ;
if ( ! shsurf - > appid_output_assigned & & app_id ) {
struct weston_output * output = NULL ;
/* reset previous output being set in _added() as the output is
* being cached */
shsurf - > output = NULL ;
output = kiosk_shell_surface_find_best_output ( shsurf ) ;
kiosk_shell_surface_set_output ( shsurf , output ) ;
weston_desktop_surface_set_size ( shsurf - > desktop_surface ,
shsurf - > output - > width ,
shsurf - > output - > height ) ;
/* even if we couldn't find an appid set for a particular
* output still flag the shsurf as to a avoid changing the
* output every time */
shsurf - > appid_output_assigned = true ;
}
/* TODO: When the top-level surface is committed with a new size after an
/* TODO: When the top-level surface is committed with a new size after an
* output resize , sometimes the view appears scaled . What state are we not
* output resize , sometimes the view appears scaled . What state are we not
* updating ?
* updating ?