@ -4124,13 +4124,34 @@ desktop_shell_desktop_ready(struct wl_client *client,
shell_fade_startup ( shell ) ;
shell_fade_startup ( shell ) ;
}
}
static void
desktop_shell_set_panel_position ( struct wl_client * client ,
struct wl_resource * resource ,
uint32_t position )
{
struct desktop_shell * shell = wl_resource_get_user_data ( resource ) ;
if ( position ! = DESKTOP_SHELL_PANEL_POSITION_TOP & &
position ! = DESKTOP_SHELL_PANEL_POSITION_BOTTOM & &
position ! = DESKTOP_SHELL_PANEL_POSITION_LEFT & &
position ! = DESKTOP_SHELL_PANEL_POSITION_RIGHT ) {
wl_resource_post_error ( resource ,
DESKTOP_SHELL_ERROR_INVALID_ARGUMENT ,
" bad position argument " ) ;
return ;
}
shell - > panel_position = position ;
}
static const struct desktop_shell_interface desktop_shell_implementation = {
static const struct desktop_shell_interface desktop_shell_implementation = {
desktop_shell_set_background ,
desktop_shell_set_background ,
desktop_shell_set_panel ,
desktop_shell_set_panel ,
desktop_shell_set_lock_surface ,
desktop_shell_set_lock_surface ,
desktop_shell_unlock ,
desktop_shell_unlock ,
desktop_shell_set_grab_surface ,
desktop_shell_set_grab_surface ,
desktop_shell_desktop_ready
desktop_shell_desktop_ready ,
desktop_shell_set_panel_position
} ;
} ;
static enum shell_surface_type
static enum shell_surface_type
@ -5344,7 +5365,7 @@ bind_desktop_shell(struct wl_client *client,
struct wl_resource * resource ;
struct wl_resource * resource ;
resource = wl_resource_create ( client , & desktop_shell_interface ,
resource = wl_resource_create ( client , & desktop_shell_interface ,
MIN ( version , 2 ) , id ) ;
MIN ( version , 3 ) , id ) ;
if ( client = = shell - > child . client ) {
if ( client = = shell - > child . client ) {
wl_resource_set_implementation ( resource ,
wl_resource_set_implementation ( resource ,
@ -6265,7 +6286,7 @@ module_init(struct weston_compositor *ec,
return - 1 ;
return - 1 ;
if ( wl_global_create ( ec - > wl_display ,
if ( wl_global_create ( ec - > wl_display ,
& desktop_shell_interface , 2 ,
& desktop_shell_interface , 3 ,
shell , bind_desktop_shell ) = = NULL )
shell , bind_desktop_shell ) = = NULL )
return - 1 ;
return - 1 ;
@ -6279,6 +6300,8 @@ module_init(struct weston_compositor *ec,
shell - > child . deathstamp = weston_compositor_get_time ( ) ;
shell - > child . deathstamp = weston_compositor_get_time ( ) ;
shell - > panel_position = DESKTOP_SHELL_PANEL_POSITION_TOP ;
setup_output_destroy_handler ( ec , shell ) ;
setup_output_destroy_handler ( ec , shell ) ;
loop = wl_display_get_event_loop ( ec - > wl_display ) ;
loop = wl_display_get_event_loop ( ec - > wl_display ) ;