@ -38,7 +38,7 @@
struct shell_surface ;
struct shell_surface ;
struct wl _shell {
struct desktop _shell {
struct weston_compositor * compositor ;
struct weston_compositor * compositor ;
struct wl_listener lock_listener ;
struct wl_listener lock_listener ;
@ -101,7 +101,7 @@ struct shell_surface {
struct weston_surface * surface ;
struct weston_surface * surface ;
struct wl_listener surface_destroy_listener ;
struct wl_listener surface_destroy_listener ;
struct shell_surface * parent ;
struct shell_surface * parent ;
struct wl _shell * shell ;
struct desktop _shell * shell ;
enum shell_surface_type type ;
enum shell_surface_type type ;
int32_t saved_x , saved_y ;
int32_t saved_x , saved_y ;
@ -193,7 +193,7 @@ static struct shell_surface *
get_shell_surface ( struct weston_surface * surface ) ;
get_shell_surface ( struct weston_surface * surface ) ;
static void
static void
shell_configuration ( struct wl _shell * shell )
shell_configuration ( struct desktop _shell * shell )
{
{
char * config_file ;
char * config_file ;
char * path = NULL ;
char * path = NULL ;
@ -516,14 +516,15 @@ shell_surface_set_transient(struct wl_client *client,
shsurf - > type = SHELL_SURFACE_TRANSIENT ;
shsurf - > type = SHELL_SURFACE_TRANSIENT ;
}
}
static struct wl _shell *
static struct desktop _shell *
shell_surface_get_shell ( struct shell_surface * shsurf )
shell_surface_get_shell ( struct shell_surface * shsurf )
{
{
return shsurf - > shell ;
return shsurf - > shell ;
}
}
static int
static int
get_output_panel_height ( struct wl_shell * wlshell , struct weston_output * output )
get_output_panel_height ( struct desktop_shell * shell ,
struct weston_output * output )
{
{
struct shell_surface * priv ;
struct shell_surface * priv ;
int panel_height = 0 ;
int panel_height = 0 ;
@ -531,7 +532,7 @@ get_output_panel_height(struct wl_shell *wlshell,struct weston_output *output)
if ( ! output )
if ( ! output )
return 0 ;
return 0 ;
wl_list_for_each ( priv , & wl shell- > panels , link ) {
wl_list_for_each ( priv , & shell - > panels , link ) {
if ( priv - > output = = output ) {
if ( priv - > output = = output ) {
panel_height = priv - > surface - > geometry . height ;
panel_height = priv - > surface - > geometry . height ;
break ;
break ;
@ -547,7 +548,7 @@ shell_surface_set_maximized(struct wl_client *client,
{
{
struct shell_surface * shsurf = resource - > data ;
struct shell_surface * shsurf = resource - > data ;
struct weston_surface * es = shsurf - > surface ;
struct weston_surface * es = shsurf - > surface ;
struct wl _shell * wl shell = NULL ;
struct desktop _shell * shell = NULL ;
uint32_t edges = 0 , panel_height = 0 ;
uint32_t edges = 0 , panel_height = 0 ;
/* get the default output, if the client set it as NULL
/* get the default output, if the client set it as NULL
@ -564,8 +565,8 @@ shell_surface_set_maximized(struct wl_client *client,
shsurf - > saved_y = es - > geometry . y ;
shsurf - > saved_y = es - > geometry . y ;
shsurf - > saved_position_valid = true ;
shsurf - > saved_position_valid = true ;
wl shell = shell_surface_get_shell ( shsurf ) ;
shell = shell_surface_get_shell ( shsurf ) ;
panel_height = get_output_panel_height ( wl shell, es - > output ) ;
panel_height = get_output_panel_height ( shell , es - > output ) ;
edges = WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT ;
edges = WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT ;
wl_shell_surface_send_configure ( & shsurf - > resource , edges ,
wl_shell_surface_send_configure ( & shsurf - > resource , edges ,
@ -650,7 +651,7 @@ static void
shell_stack_fullscreen ( struct shell_surface * shsurf )
shell_stack_fullscreen ( struct shell_surface * shsurf )
{
{
struct weston_surface * surface = shsurf - > surface ;
struct weston_surface * surface = shsurf - > surface ;
struct wl _shell * shell = shell_surface_get_shell ( shsurf ) ;
struct desktop _shell * shell = shell_surface_get_shell ( shsurf ) ;
wl_list_remove ( & surface - > layer_link ) ;
wl_list_remove ( & surface - > layer_link ) ;
wl_list_remove ( & shsurf - > fullscreen . black_surface - > layer_link ) ;
wl_list_remove ( & shsurf - > fullscreen . black_surface - > layer_link ) ;
@ -957,7 +958,7 @@ handle_screensaver_sigchld(struct weston_process *proc, int status)
}
}
static void
static void
launch_screensaver ( struct wl _shell * shell )
launch_screensaver ( struct desktop _shell * shell )
{
{
if ( shell - > screensaver . binding )
if ( shell - > screensaver . binding )
return ;
return ;
@ -977,7 +978,7 @@ launch_screensaver(struct wl_shell *shell)
}
}
static void
static void
terminate_screensaver ( struct wl _shell * shell )
terminate_screensaver ( struct desktop _shell * shell )
{
{
if ( shell - > screensaver . process . pid = = 0 )
if ( shell - > screensaver . process . pid = = 0 )
return ;
return ;
@ -986,7 +987,7 @@ terminate_screensaver(struct wl_shell *shell)
}
}
static void
static void
show_screensaver ( struct wl _shell * shell , struct shell_surface * surface )
show_screensaver ( struct desktop _shell * shell , struct shell_surface * surface )
{
{
struct wl_list * list ;
struct wl_list * list ;
@ -1002,7 +1003,7 @@ show_screensaver(struct wl_shell *shell, struct shell_surface *surface)
}
}
static void
static void
hide_screensaver ( struct wl _shell * shell , struct shell_surface * surface )
hide_screensaver ( struct desktop _shell * shell , struct shell_surface * surface )
{
{
wl_list_remove ( & surface - > surface - > layer_link ) ;
wl_list_remove ( & surface - > surface - > layer_link ) ;
wl_list_init ( & surface - > surface - > layer_link ) ;
wl_list_init ( & surface - > surface - > layer_link ) ;
@ -1015,7 +1016,7 @@ desktop_shell_set_background(struct wl_client *client,
struct wl_resource * output_resource ,
struct wl_resource * output_resource ,
struct wl_resource * surface_resource )
struct wl_resource * surface_resource )
{
{
struct wl _shell * shell = resource - > data ;
struct desktop _shell * shell = resource - > data ;
struct shell_surface * shsurf = surface_resource - > data ;
struct shell_surface * shsurf = surface_resource - > data ;
struct weston_surface * surface = shsurf - > surface ;
struct weston_surface * surface = shsurf - > surface ;
struct shell_surface * priv ;
struct shell_surface * priv ;
@ -1052,7 +1053,7 @@ desktop_shell_set_panel(struct wl_client *client,
struct wl_resource * output_resource ,
struct wl_resource * output_resource ,
struct wl_resource * surface_resource )
struct wl_resource * surface_resource )
{
{
struct wl _shell * shell = resource - > data ;
struct desktop _shell * shell = resource - > data ;
struct shell_surface * shsurf = surface_resource - > data ;
struct shell_surface * shsurf = surface_resource - > data ;
struct weston_surface * surface = shsurf - > surface ;
struct weston_surface * surface = shsurf - > surface ;
struct shell_surface * priv ;
struct shell_surface * priv ;
@ -1086,8 +1087,8 @@ desktop_shell_set_panel(struct wl_client *client,
static void
static void
handle_lock_surface_destroy ( struct wl_listener * listener , void * data )
handle_lock_surface_destroy ( struct wl_listener * listener , void * data )
{
{
struct wl _shell * shell =
struct desktop _shell * shell =
container_of ( listener , struct wl _shell, lock_surface_listener ) ;
container_of ( listener , struct desktop _shell, lock_surface_listener ) ;
fprintf ( stderr , " lock surface gone \n " ) ;
fprintf ( stderr , " lock surface gone \n " ) ;
shell - > lock_surface = NULL ;
shell - > lock_surface = NULL ;
@ -1098,7 +1099,7 @@ desktop_shell_set_lock_surface(struct wl_client *client,
struct wl_resource * resource ,
struct wl_resource * resource ,
struct wl_resource * surface_resource )
struct wl_resource * surface_resource )
{
{
struct wl _shell * shell = resource - > data ;
struct desktop _shell * shell = resource - > data ;
struct shell_surface * surface = surface_resource - > data ;
struct shell_surface * surface = surface_resource - > data ;
if ( reset_shell_surface_type ( surface ) )
if ( reset_shell_surface_type ( surface ) )
@ -1119,7 +1120,7 @@ desktop_shell_set_lock_surface(struct wl_client *client,
}
}
static void
static void
resume_desktop ( struct wl _shell * shell )
resume_desktop ( struct desktop _shell * shell )
{
{
struct shell_surface * tmp ;
struct shell_surface * tmp ;
@ -1145,7 +1146,7 @@ static void
desktop_shell_unlock ( struct wl_client * client ,
desktop_shell_unlock ( struct wl_client * client ,
struct wl_resource * resource )
struct wl_resource * resource )
{
{
struct wl _shell * shell = resource - > data ;
struct desktop _shell * shell = resource - > data ;
shell - > prepare_event_sent = false ;
shell - > prepare_event_sent = false ;
@ -1476,7 +1477,7 @@ rotate_binding(struct wl_input_device *device, uint32_t time,
}
}
static void
static void
activate ( struct wl _shell * shell , struct weston_surface * es ,
activate ( struct desktop _shell * shell , struct weston_surface * es ,
struct weston_input_device * device )
struct weston_input_device * device )
{
{
struct weston_surface * surf , * prev ;
struct weston_surface * surf , * prev ;
@ -1539,7 +1540,7 @@ click_to_activate_binding(struct wl_input_device *device,
uint32_t button , uint32_t axis , int32_t state , void * data )
uint32_t button , uint32_t axis , int32_t state , void * data )
{
{
struct weston_input_device * wd = ( struct weston_input_device * ) device ;
struct weston_input_device * wd = ( struct weston_input_device * ) device ;
struct wl _shell * shell = data ;
struct desktop _shell * shell = data ;
struct weston_surface * focus ;
struct weston_surface * focus ;
struct weston_surface * upper ;
struct weston_surface * upper ;
@ -1557,8 +1558,8 @@ click_to_activate_binding(struct wl_input_device *device,
static void
static void
lock ( struct wl_listener * listener , void * data )
lock ( struct wl_listener * listener , void * data )
{
{
struct wl _shell * shell =
struct desktop _shell * shell =
container_of ( listener , struct wl _shell, lock_listener ) ;
container_of ( listener , struct desktop _shell, lock_listener ) ;
struct weston_input_device * device ;
struct weston_input_device * device ;
struct shell_surface * shsurf ;
struct shell_surface * shsurf ;
struct weston_output * output ;
struct weston_output * output ;
@ -1611,8 +1612,8 @@ lock(struct wl_listener *listener, void *data)
static void
static void
unlock ( struct wl_listener * listener , void * data )
unlock ( struct wl_listener * listener , void * data )
{
{
struct wl _shell * shell =
struct desktop _shell * shell =
container_of ( listener , struct wl _shell, unlock_listener ) ;
container_of ( listener , struct desktop _shell, unlock_listener ) ;
if ( ! shell - > locked | | shell - > lock_surface ) {
if ( ! shell - > locked | | shell - > lock_surface ) {
weston_compositor_wake ( shell - > compositor ) ;
weston_compositor_wake ( shell - > compositor ) ;
@ -1643,7 +1644,7 @@ center_on_output(struct weston_surface *surface, struct weston_output *output)
}
}
static void
static void
map ( struct wl _shell * shell , struct weston_surface * surface ,
map ( struct desktop _shell * shell , struct weston_surface * surface ,
int32_t width , int32_t height , int32_t sx , int32_t sy )
int32_t width , int32_t height , int32_t sx , int32_t sy )
{
{
struct weston_compositor * compositor = shell - > compositor ;
struct weston_compositor * compositor = shell - > compositor ;
@ -1759,7 +1760,7 @@ map(struct wl_shell *shell, struct weston_surface *surface,
}
}
static void
static void
configure ( struct wl _shell * shell , struct weston_surface * surface ,
configure ( struct desktop _shell * shell , struct weston_surface * surface ,
GLfloat x , GLfloat y , int32_t width , int32_t height )
GLfloat x , GLfloat y , int32_t width , int32_t height )
{
{
enum shell_surface_type surface_type = SHELL_SURFACE_NONE ;
enum shell_surface_type surface_type = SHELL_SURFACE_NONE ;
@ -1812,7 +1813,7 @@ static void
shell_surface_configure ( struct weston_surface * es , int32_t sx , int32_t sy )
shell_surface_configure ( struct weston_surface * es , int32_t sx , int32_t sy )
{
{
struct shell_surface * shsurf = get_shell_surface ( es ) ;
struct shell_surface * shsurf = get_shell_surface ( es ) ;
struct wl _shell * shell = shsurf - > shell ;
struct desktop _shell * shell = shsurf - > shell ;
if ( ! weston_surface_is_mapped ( es ) ) {
if ( ! weston_surface_is_mapped ( es ) ) {
map ( shell , es , es - > buffer - > width , es - > buffer - > height , sx , sy ) ;
map ( shell , es , es - > buffer - > width , es - > buffer - > height , sx , sy ) ;
@ -1832,14 +1833,14 @@ shell_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy)
}
}
}
}
static int launch_desktop_shell_process ( struct wl _shell * shell ) ;
static int launch_desktop_shell_process ( struct desktop _shell * shell ) ;
static void
static void
desktop_shell_sigchld ( struct weston_process * process , int status )
desktop_shell_sigchld ( struct weston_process * process , int status )
{
{
uint32_t time ;
uint32_t time ;
struct wl _shell * shell =
struct desktop _shell * shell =
container_of ( process , struct wl _shell, child . process ) ;
container_of ( process , struct desktop _shell, child . process ) ;
shell - > child . process . pid = 0 ;
shell - > child . process . pid = 0 ;
shell - > child . client = NULL ; /* already destroyed by wayland */
shell - > child . client = NULL ; /* already destroyed by wayland */
@ -1862,7 +1863,7 @@ desktop_shell_sigchld(struct weston_process *process, int status)
}
}
static int
static int
launch_desktop_shell_process ( struct wl _shell * shell )
launch_desktop_shell_process ( struct desktop _shell * shell )
{
{
const char * shell_exe = LIBEXECDIR " /weston-desktop-shell " ;
const char * shell_exe = LIBEXECDIR " /weston-desktop-shell " ;
@ -1879,7 +1880,7 @@ launch_desktop_shell_process(struct wl_shell *shell)
static void
static void
bind_shell ( struct wl_client * client , void * data , uint32_t version , uint32_t id )
bind_shell ( struct wl_client * client , void * data , uint32_t version , uint32_t id )
{
{
struct wl _shell * shell = data ;
struct desktop _shell * shell = data ;
wl_client_add_object ( client , & wl_shell_interface ,
wl_client_add_object ( client , & wl_shell_interface ,
& shell_implementation , id , shell ) ;
& shell_implementation , id , shell ) ;
@ -1888,7 +1889,7 @@ bind_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id)
static void
static void
unbind_desktop_shell ( struct wl_resource * resource )
unbind_desktop_shell ( struct wl_resource * resource )
{
{
struct wl _shell * shell = resource - > data ;
struct desktop _shell * shell = resource - > data ;
if ( shell - > locked )
if ( shell - > locked )
resume_desktop ( shell ) ;
resume_desktop ( shell ) ;
@ -1902,7 +1903,7 @@ static void
bind_desktop_shell ( struct wl_client * client ,
bind_desktop_shell ( struct wl_client * client ,
void * data , uint32_t version , uint32_t id )
void * data , uint32_t version , uint32_t id )
{
{
struct wl _shell * shell = data ;
struct desktop _shell * shell = data ;
struct wl_resource * resource ;
struct wl_resource * resource ;
resource = wl_client_add_object ( client , & desktop_shell_interface ,
resource = wl_client_add_object ( client , & desktop_shell_interface ,
@ -1926,7 +1927,7 @@ screensaver_set_surface(struct wl_client *client,
struct wl_resource * shell_surface_resource ,
struct wl_resource * shell_surface_resource ,
struct wl_resource * output_resource )
struct wl_resource * output_resource )
{
{
struct wl _shell * shell = resource - > data ;
struct desktop _shell * shell = resource - > data ;
struct shell_surface * surface = shell_surface_resource - > data ;
struct shell_surface * surface = shell_surface_resource - > data ;
struct weston_output * output = output_resource - > data ;
struct weston_output * output = output_resource - > data ;
@ -1947,7 +1948,7 @@ static const struct screensaver_interface screensaver_implementation = {
static void
static void
unbind_screensaver ( struct wl_resource * resource )
unbind_screensaver ( struct wl_resource * resource )
{
{
struct wl _shell * shell = resource - > data ;
struct desktop _shell * shell = resource - > data ;
shell - > screensaver . binding = NULL ;
shell - > screensaver . binding = NULL ;
free ( resource ) ;
free ( resource ) ;
@ -1957,7 +1958,7 @@ static void
bind_screensaver ( struct wl_client * client ,
bind_screensaver ( struct wl_client * client ,
void * data , uint32_t version , uint32_t id )
void * data , uint32_t version , uint32_t id )
{
{
struct wl _shell * shell = data ;
struct desktop _shell * shell = data ;
struct wl_resource * resource ;
struct wl_resource * resource ;
resource = wl_client_add_object ( client , & screensaver_interface ,
resource = wl_client_add_object ( client , & screensaver_interface ,
@ -1976,7 +1977,7 @@ bind_screensaver(struct wl_client *client,
}
}
struct switcher {
struct switcher {
struct wl _shell * shell ;
struct desktop _shell * shell ;
struct weston_surface * current ;
struct weston_surface * current ;
struct wl_listener listener ;
struct wl_listener listener ;
struct wl_keyboard_grab grab ;
struct wl_keyboard_grab grab ;
@ -2086,7 +2087,7 @@ switcher_binding(struct wl_input_device *device, uint32_t time,
uint32_t key , uint32_t button , uint32_t axis ,
uint32_t key , uint32_t button , uint32_t axis ,
int32_t state , void * data )
int32_t state , void * data )
{
{
struct wl _shell * shell = data ;
struct desktop _shell * shell = data ;
struct switcher * switcher ;
struct switcher * switcher ;
switcher = malloc ( sizeof * switcher ) ;
switcher = malloc ( sizeof * switcher ) ;
@ -2138,7 +2139,7 @@ static void
debug_repaint_binding ( struct wl_input_device * device , uint32_t time ,
debug_repaint_binding ( struct wl_input_device * device , uint32_t time ,
uint32_t key , uint32_t button , uint32_t axis , int32_t state , void * data )
uint32_t key , uint32_t button , uint32_t axis , int32_t state , void * data )
{
{
struct wl _shell * shell = data ;
struct desktop _shell * shell = data ;
struct weston_compositor * compositor = shell - > compositor ;
struct weston_compositor * compositor = shell - > compositor ;
struct weston_surface * surface ;
struct weston_surface * surface ;
@ -2171,8 +2172,8 @@ debug_repaint_binding(struct wl_input_device *device, uint32_t time,
static void
static void
shell_destroy ( struct wl_listener * listener , void * data )
shell_destroy ( struct wl_listener * listener , void * data )
{
{
struct wl _shell * shell =
struct desktop _shell * shell =
container_of ( listener , struct wl _shell, destroy_listener ) ;
container_of ( listener , struct desktop _shell, destroy_listener ) ;
if ( shell - > child . client )
if ( shell - > child . client )
wl_client_destroy ( shell - > child . client ) ;
wl_client_destroy ( shell - > child . client ) ;
@ -2187,7 +2188,7 @@ shell_init(struct weston_compositor *ec);
WL_EXPORT int
WL_EXPORT int
shell_init ( struct weston_compositor * ec )
shell_init ( struct weston_compositor * ec )
{
{
struct wl _shell * shell ;
struct desktop _shell * shell ;
shell = malloc ( sizeof * shell ) ;
shell = malloc ( sizeof * shell ) ;
if ( shell = = NULL )
if ( shell = = NULL )