@ -55,7 +55,7 @@
# include "shared/cairo-util.h"
# include "shared/timespec-util.h"
# include "fullscreen-shell-unstable-v1-client-protocol.h"
# include "xdg-shell-unstable-v6- client-protocol.h"
# include "xdg-shell-client-protocol.h"
# include "presentation-time-server-protocol.h"
# include "linux-dmabuf.h"
# include "windowed-output-api.h"
@ -71,7 +71,7 @@ struct wayland_backend {
struct wl_registry * registry ;
struct wl_compositor * compositor ;
struct wl_shell * shell ;
struct z xdg_sh ell_v6 * xdg_sh ell ;
struct xdg_wm_ba se * xdg_wm_ba se ;
struct zwp_fullscreen_shell_v1 * fshell ;
struct wl_shm * shm ;
@ -104,8 +104,8 @@ struct wayland_output {
uint32_t global_id ;
struct wl_shell_surface * shell_surface ;
struct z xdg_surface_v6 * xdg_surface ;
struct z xdg_toplevel_v6 * xdg_toplevel ;
struct xdg_surface * xdg_surface ;
struct xdg_toplevel * xdg_toplevel ;
int configure_width , configure_height ;
bool wait_for_configure ;
} parent ;
@ -661,12 +661,12 @@ wayland_backend_destroy_output_surface(struct wayland_output *output)
assert ( output - > parent . surface ) ;
if ( output - > parent . xdg_toplevel ) {
z xdg_toplevel_v6 _destroy( output - > parent . xdg_toplevel ) ;
xdg_toplevel_destroy ( output - > parent . xdg_toplevel ) ;
output - > parent . xdg_toplevel = NULL ;
}
if ( output - > parent . xdg_surface ) {
z xdg_surface_v6 _destroy( output - > parent . xdg_surface ) ;
xdg_surface_destroy ( output - > parent . xdg_surface ) ;
output - > parent . xdg_surface = NULL ;
}
@ -810,11 +810,11 @@ wayland_output_resize_surface(struct wayland_output *output)
wl_region_destroy ( region ) ;
if ( output - > parent . xdg_surface ) {
z xdg_surface_v6 _set_window_geometry( output - > parent . xdg_surface ,
ix ,
iy ,
iwidth ,
iheight ) ;
xdg_surface_set_window_geometry ( output - > parent . xdg_surface ,
ix ,
iy ,
iwidth ,
iheight ) ;
}
frame_opaque_rect ( output - > frame , & ix , & iy , & iwidth , & iheight ) ;
@ -837,11 +837,11 @@ wayland_output_resize_surface(struct wayland_output *output)
wl_region_destroy ( region ) ;
if ( output - > parent . xdg_surface ) {
z xdg_surface_v6 _set_window_geometry( output - > parent . xdg_surface ,
0 ,
0 ,
width ,
height ) ;
xdg_surface_set_window_geometry ( output - > parent . xdg_surface ,
0 ,
0 ,
width ,
height ) ;
}
}
@ -902,7 +902,7 @@ wayland_output_set_windowed(struct wayland_output *output)
wayland_output_resize_surface ( output ) ;
if ( output - > parent . xdg_toplevel ) {
z xdg_toplevel_v6 _unset_fullscreen( output - > parent . xdg_toplevel ) ;
xdg_toplevel_unset_fullscreen ( output - > parent . xdg_toplevel ) ;
} else if ( output - > parent . shell_surface ) {
wl_shell_surface_set_toplevel ( output - > parent . shell_surface ) ;
} else {
@ -925,7 +925,7 @@ wayland_output_set_fullscreen(struct wayland_output *output,
wayland_output_resize_surface ( output ) ;
if ( output - > parent . xdg_toplevel ) {
z xdg_toplevel_v6 _set_fullscreen( output - > parent . xdg_toplevel , target ) ;
xdg_toplevel_set_fullscreen ( output - > parent . xdg_toplevel , target ) ;
} else if ( output - > parent . shell_surface ) {
wl_shell_surface_set_fullscreen ( output - > parent . shell_surface ,
method , framerate , target ) ;
@ -1116,18 +1116,18 @@ err_output:
}
static void
handle_xdg_surface_configure ( void * data , struct z xdg_surface_v6 * surface ,
handle_xdg_surface_configure ( void * data , struct xdg_surface * surface ,
uint32_t serial )
{
z xdg_surface_v6 _ack_configure( surface , serial ) ;
xdg_surface_ack_configure ( surface , serial ) ;
}
static const struct z xdg_surface_v6 _listener xdg_surface_listener = {
static const struct xdg_surface_listener xdg_surface_listener = {
handle_xdg_surface_configure
} ;
static void
handle_xdg_toplevel_configure ( void * data , struct z xdg_toplevel_v6 * toplevel ,
handle_xdg_toplevel_configure ( void * data , struct xdg_toplevel * toplevel ,
int32_t width , int32_t height ,
struct wl_array * states )
{
@ -1141,7 +1141,7 @@ handle_xdg_toplevel_configure(void *data, struct zxdg_toplevel_v6 *toplevel,
}
static void
handle_xdg_toplevel_close ( void * data , struct z xdg_toplevel_v6 * xdg_toplevel )
handle_xdg_toplevel_close ( void * data , struct xdg_toplevel * xdg_toplevel )
{
struct wayland_output * output = data ;
struct weston_compositor * compositor = output - > base . compositor ;
@ -1152,7 +1152,7 @@ handle_xdg_toplevel_close(void *data, struct zxdg_toplevel_v6 *xdg_toplevel)
weston_compositor_exit ( compositor ) ;
}
static const struct z xdg_toplevel_v6 _listener xdg_toplevel_listener = {
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
handle_xdg_toplevel_configure ,
handle_xdg_toplevel_close ,
} ;
@ -1173,19 +1173,19 @@ wayland_backend_create_output_surface(struct wayland_output *output)
output - > parent . draw_initial_frame = true ;
if ( b - > parent . xdg_sh ell ) {
if ( b - > parent . xdg_wm_ba se ) {
output - > parent . xdg_surface =
z xdg_sh ell_v6 _get_xdg_surface( b - > parent . xdg_sh ell ,
output - > parent . surface ) ;
z xdg_surface_v6 _add_listener( output - > parent . xdg_surface ,
& xdg_surface_listener , output ) ;
xdg_wm_ba se_get_xdg_surface ( b - > parent . xdg_wm_ba se ,
output - > parent . surface ) ;
xdg_surface_add_listener ( output - > parent . xdg_surface ,
& xdg_surface_listener , output ) ;
output - > parent . xdg_toplevel =
z xdg_surface_v6 _get_toplevel( output - > parent . xdg_surface ) ;
z xdg_toplevel_v6 _add_listener( output - > parent . xdg_toplevel ,
& xdg_toplevel_listener , output ) ;
xdg_surface_get_toplevel ( output - > parent . xdg_surface ) ;
xdg_toplevel_add_listener ( output - > parent . xdg_toplevel ,
& xdg_toplevel_listener , output ) ;
z xdg_toplevel_v6 _set_title( output - > parent . xdg_toplevel , output - > title ) ;
xdg_toplevel_set_title ( output - > parent . xdg_toplevel , output - > title ) ;
wl_surface_commit ( output - > parent . surface ) ;
@ -1194,7 +1194,7 @@ wayland_backend_create_output_surface(struct wayland_output *output)
while ( output - > parent . wait_for_configure )
wl_display_dispatch ( b - > parent . wl_display ) ;
weston_log ( " wayland-backend: Using xdg_sh ell_v6 \n " ) ;
weston_log ( " wayland-backend: Using xdg_wm_ba se \n " ) ;
}
else if ( b - > parent . shell ) {
output - > parent . shell_surface =
@ -1539,10 +1539,10 @@ wayland_output_setup_fullscreen(struct wayland_output *output,
return - 1 ;
/* What should size be set if conditional is false? */
if ( b - > parent . xdg_sh ell | | b - > parent . shell ) {
if ( b - > parent . xdg_wm_ba se | | b - > parent . shell ) {
if ( output - > parent . xdg_toplevel )
z xdg_toplevel_v6 _set_fullscreen( output - > parent . xdg_toplevel ,
output - > parent . output ) ;
xdg_toplevel_set_fullscreen ( output - > parent . xdg_toplevel ,
output - > parent . output ) ;
else if ( output - > parent . shell_surface )
wl_shell_surface_set_fullscreen ( output - > parent . shell_surface ,
0 , 0 , NULL ) ;
@ -1774,8 +1774,8 @@ input_handle_button(void *data, struct wl_pointer *pointer,
if ( frame_status ( input - > output - > frame ) & FRAME_STATUS_MOVE ) {
if ( input - > output - > parent . xdg_toplevel )
z xdg_toplevel_v6 _move( input - > output - > parent . xdg_toplevel ,
input - > parent . seat , serial ) ;
xdg_toplevel_move ( input - > output - > parent . xdg_toplevel ,
input - > parent . seat , serial ) ;
else if ( input - > output - > parent . shell_surface )
wl_shell_surface_move ( input - > output - > parent . shell_surface ,
input - > parent . seat , serial ) ;
@ -2130,8 +2130,8 @@ input_handle_touch_down(void *data, struct wl_touch *wl_touch,
if ( first_touch & & ( frame_status ( output - > frame ) & FRAME_STATUS_MOVE ) ) {
input - > touch_points - - ;
if ( output - > parent . xdg_toplevel )
z xdg_toplevel_v6 _move( output - > parent . xdg_toplevel ,
input - > parent . seat , serial ) ;
xdg_toplevel_move ( output - > parent . xdg_toplevel ,
input - > parent . seat , serial ) ;
else if ( output - > parent . shell_surface )
wl_shell_surface_move ( output - > parent . shell_surface ,
input - > parent . seat , serial ) ;
@ -2528,13 +2528,13 @@ wayland_parent_output_destroy(struct wayland_parent_output *output)
}
static void
xdg_sh ell _ping ( void * data , struct z xdg_sh ell_v6 * shell , uint32_t serial )
xdg_wm_ba se_ping ( void * data , struct xdg_wm_ba se * shell , uint32_t serial )
{
z xdg_sh ell_v6 _pong( shell , serial ) ;
xdg_wm_ba se_pong ( shell , serial ) ;
}
static const struct zxdg_shell_v6_listener xdg_shell _listener = {
xdg_sh ell _ping ,
static const struct xdg_wm_base_listener wm_base _listener = {
xdg_wm_ba se_ping ,
} ;
static void
@ -2548,12 +2548,12 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
wl_registry_bind ( registry , name ,
& wl_compositor_interface ,
MIN ( version , 4 ) ) ;
} else if ( strcmp ( interface , " z xdg_sh ell_v6 " ) = = 0 ) {
b - > parent . xdg_sh ell =
} else if ( strcmp ( interface , " xdg_wm_ba se " ) = = 0 ) {
b - > parent . xdg_wm_ba se =
wl_registry_bind ( registry , name ,
& z xdg_sh ell_v6 _interface, 1 ) ;
z xdg_sh ell_v6 _add_listener( b - > parent . xdg_sh ell ,
& xdg_shell _listener , b ) ;
& xdg_wm_ba se_interface , 1 ) ;
xdg_wm_ba se_add_listener ( b - > parent . xdg_wm_ba se ,
& wm_base _listener, b ) ;
} else if ( strcmp ( interface , " wl_shell " ) = = 0 ) {
b - > parent . shell =
wl_registry_bind ( registry , name ,
@ -2629,8 +2629,8 @@ wayland_destroy(struct weston_compositor *ec)
if ( b - > parent . shm )
wl_shm_destroy ( b - > parent . shm ) ;
if ( b - > parent . xdg_sh ell )
z xdg_sh ell_v6 _destroy( b - > parent . xdg_sh ell ) ;
if ( b - > parent . xdg_wm_ba se )
xdg_wm_ba se_destroy ( b - > parent . xdg_wm_ba se ) ;
if ( b - > parent . shell )
wl_shell_destroy ( b - > parent . shell ) ;