Commit 496adb3b authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Pekka Paalanen

Use fullscreen-shell.xml from wayland-protocols

Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
Signed-off-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
Reviewed-by: default avatarMariusz Ceier <mceier+wayland@gmail.com>
Acked-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
parent 4bcc54d1
......@@ -309,8 +309,8 @@ wayland_backend_la_SOURCES = \
src/compositor-wayland.c \
shared/helpers.h
nodist_wayland_backend_la_SOURCES = \
protocol/fullscreen-shell-protocol.c \
protocol/fullscreen-shell-client-protocol.h
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif
if ENABLE_RPI_COMPOSITOR
......@@ -475,8 +475,8 @@ weston_simple_shm_SOURCES = clients/simple-shm.c
nodist_weston_simple_shm_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/fullscreen-shell-protocol.c \
protocol/fullscreen-shell-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
......@@ -488,8 +488,8 @@ nodist_weston_simple_damage_SOURCES = \
protocol/scaler-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/fullscreen-shell-protocol.c \
protocol/fullscreen-shell-client-protocol.h
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
......@@ -531,8 +531,8 @@ weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c
nodist_weston_simple_dmabuf_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/fullscreen-shell-protocol.c \
protocol/fullscreen-shell-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-protocol.c \
protocol/linux-dmabuf-client-protocol.h
weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS)
......@@ -649,8 +649,8 @@ weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
weston_fullscreen_SOURCES = clients/fullscreen.c
nodist_weston_fullscreen_SOURCES = \
protocol/fullscreen-shell-protocol.c \
protocol/fullscreen-shell-client-protocol.h
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_fullscreen_LDADD = libtoytoolkit.la
weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
......@@ -763,8 +763,8 @@ BUILT_SOURCES += \
protocol/scaler-protocol.c \
protocol/workspaces-client-protocol.h \
protocol/workspaces-protocol.c \
protocol/fullscreen-shell-protocol.c \
protocol/fullscreen-shell-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/ivi-hmi-controller-protocol.c \
......@@ -865,8 +865,8 @@ fullscreen_shell_la_SOURCES = \
fullscreen-shell/fullscreen-shell.c \
shared/helpers.h
nodist_fullscreen_shell_la_SOURCES = \
protocol/fullscreen-shell-protocol.c \
protocol/fullscreen-shell-server-protocol.h
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-server-protocol.h
BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES)
endif
......@@ -931,8 +931,8 @@ screen_share_la_SOURCES = \
src/screen-share.c \
shared/helpers.h
nodist_screen_share_la_SOURCES = \
protocol/fullscreen-shell-protocol.c \
protocol/fullscreen-shell-client-protocol.h
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif
......@@ -1348,7 +1348,6 @@ EXTRA_DIST += \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
protocol/xdg-shell.xml \
protocol/fullscreen-shell.xml \
protocol/presentation_timing.xml \
protocol/scaler.xml \
protocol/ivi-application.xml \
......@@ -1417,6 +1416,17 @@ $(DOCDIRS):
doc: $(DOXYGEN_INDICES)
.SECONDEXPANSION:
protocol/%-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
protocol/%-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
protocol/%-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
......
......@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
#include "fullscreen-shell-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
struct fs_output {
struct wl_list link;
......@@ -46,8 +46,8 @@ struct fullscreen {
struct display *display;
struct window *window;
struct widget *widget;
struct _wl_fullscreen_shell *fshell;
enum _wl_fullscreen_shell_present_method present_method;
struct zwp_fullscreen_shell_v1 *fshell;
enum zwp_fullscreen_shell_v1_present_method present_method;
int width, height;
int fullscreen;
float pointer_x, pointer_y;
......@@ -293,10 +293,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
if (fullscreen->current_output)
wl_output = output_get_wl_output(fullscreen->current_output->output);
fullscreen->present_method = (fullscreen->present_method + 1) % 5;
_wl_fullscreen_shell_present_surface(fullscreen->fshell,
window_get_wl_surface(fullscreen->window),
fullscreen->present_method,
wl_output);
zwp_fullscreen_shell_v1_present_surface(fullscreen->fshell,
window_get_wl_surface(fullscreen->window),
fullscreen->present_method,
wl_output);
window_schedule_redraw(window);
break;
......@@ -308,8 +308,8 @@ key_handler(struct window *window, struct input *input, uint32_t time,
wl_output = fsout ? output_get_wl_output(fsout->output) : NULL;
/* Clear the current presentation */
_wl_fullscreen_shell_present_surface(fullscreen->fshell, NULL,
0, wl_output);
zwp_fullscreen_shell_v1_present_surface(fullscreen->fshell, NULL,
0, wl_output);
if (fullscreen->current_output) {
if (fullscreen->current_output->link.next == &fullscreen->output_list)
......@@ -324,10 +324,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
fullscreen->current_output = fsout;
wl_output = fsout ? output_get_wl_output(fsout->output) : NULL;
_wl_fullscreen_shell_present_surface(fullscreen->fshell,
window_get_wl_surface(fullscreen->window),
fullscreen->present_method,
wl_output);
zwp_fullscreen_shell_v1_present_surface(fullscreen->fshell,
window_get_wl_surface(fullscreen->window),
fullscreen->present_method,
wl_output);
window_schedule_redraw(window);
break;
......@@ -338,10 +338,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
wl_output = NULL;
if (fullscreen->current_output)
wl_output = output_get_wl_output(fullscreen->current_output->output);
_wl_fullscreen_shell_mode_feedback_destroy(
_wl_fullscreen_shell_present_surface_for_mode(fullscreen->fshell,
window_get_wl_surface(fullscreen->window),
wl_output, 0));
zwp_fullscreen_shell_mode_feedback_v1_destroy(
zwp_fullscreen_shell_v1_present_surface_for_mode(fullscreen->fshell,
window_get_wl_surface(fullscreen->window),
wl_output, 0));
window_schedule_redraw(window);
break;
......@@ -420,13 +420,13 @@ touch_handler(struct widget *widget, struct input *input,
}
static void
fshell_capability_handler(void *data, struct _wl_fullscreen_shell *fshell,
fshell_capability_handler(void *data, struct zwp_fullscreen_shell_v1 *fshell,
uint32_t capability)
{
struct fullscreen *fullscreen = data;
switch (capability) {
case _WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE:
case ZWP_FULLSCREEN_SHELL_V1_CAPABILITY_CURSOR_PLANE:
fullscreen->draw_cursor = 0;
break;
default:
......@@ -434,7 +434,7 @@ fshell_capability_handler(void *data, struct _wl_fullscreen_shell *fshell,
}
}
struct _wl_fullscreen_shell_listener fullscreen_shell_listener = {
struct zwp_fullscreen_shell_v1_listener fullscreen_shell_listener = {
fshell_capability_handler
};
......@@ -471,13 +471,13 @@ global_handler(struct display *display, uint32_t id, const char *interface,
{
struct fullscreen *fullscreen = data;
if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
if (strcmp(interface, "zwp_fullscreen_shell_v1") == 0) {
fullscreen->fshell = display_bind(display, id,
&_wl_fullscreen_shell_interface,
&zwp_fullscreen_shell_v1_interface,
1);
_wl_fullscreen_shell_add_listener(fullscreen->fshell,
&fullscreen_shell_listener,
fullscreen);
zwp_fullscreen_shell_v1_add_listener(fullscreen->fshell,
&fullscreen_shell_listener,
fullscreen);
}
}
......@@ -490,7 +490,7 @@ int main(int argc, char *argv[])
fullscreen.width = 640;
fullscreen.height = 480;
fullscreen.fullscreen = 0;
fullscreen.present_method = _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT;
fullscreen.present_method = ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT;
wl_list_init(&fullscreen.output_list);
fullscreen.current_output = NULL;
......@@ -525,10 +525,10 @@ int main(int argc, char *argv[])
if (fullscreen.fshell) {
fullscreen.window = window_create_custom(d);
_wl_fullscreen_shell_present_surface(fullscreen.fshell,
window_get_wl_surface(fullscreen.window),
fullscreen.present_method,
NULL);
zwp_fullscreen_shell_v1_present_surface(fullscreen.fshell,
window_get_wl_surface(fullscreen.window),
fullscreen.present_method,
NULL);
/* If we get the CURSOR_PLANE capability, we'll change this */
fullscreen.draw_cursor = 1;
} else {
......
......@@ -38,7 +38,7 @@
#include <wayland-client.h>
#include "shared/os-compatibility.h"
#include "xdg-shell-client-protocol.h"
#include "fullscreen-shell-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "scaler-client-protocol.h"
int print_debug = 0;
......@@ -50,7 +50,7 @@ struct display {
struct wl_compositor *compositor;
struct wl_scaler *scaler;
struct xdg_shell *shell;
struct _wl_fullscreen_shell *fshell;
struct zwp_fullscreen_shell_v1 *fshell;
struct wl_shm *shm;
uint32_t formats;
};
......@@ -294,10 +294,10 @@ create_window(struct display *display, int width, int height,
xdg_surface_set_title(window->xdg_surface, "simple-damage");
} else if (display->fshell) {
_wl_fullscreen_shell_present_surface(display->fshell,
window->surface,
_WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT,
NULL);
zwp_fullscreen_shell_v1_present_surface(display->fshell,
window->surface,
ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT,
NULL);
} else {
assert(0);
}
......@@ -677,9 +677,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(d->shell, XDG_VERSION);
xdg_shell_add_listener(d->shell, &xdg_shell_listener, d);
} else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
} else if (strcmp(interface, "zwp_fullscreen_shell_v1") == 0) {
d->fshell = wl_registry_bind(registry,
id, &_wl_fullscreen_shell_interface, 1);
id, &zwp_fullscreen_shell_v1_interface, 1);
} else if (strcmp(interface, "wl_shm") == 0) {
d->shm = wl_registry_bind(registry,
id, &wl_shm_interface, 1);
......@@ -742,7 +742,7 @@ destroy_display(struct display *display)
xdg_shell_destroy(display->shell);
if (display->fshell)
_wl_fullscreen_shell_release(display->fshell);
zwp_fullscreen_shell_v1_release(display->fshell);
if (display->scaler)
wl_scaler_destroy(display->scaler);
......
......@@ -41,7 +41,7 @@
#include <wayland-client.h>
#include "xdg-shell-client-protocol.h"
#include "fullscreen-shell-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "linux-dmabuf-client-protocol.h"
struct display {
......@@ -49,7 +49,7 @@ struct display {
struct wl_registry *registry;
struct wl_compositor *compositor;
struct xdg_shell *shell;
struct _wl_fullscreen_shell *fshell;
struct zwp_fullscreen_shell_v1 *fshell;
struct zlinux_dmabuf *dmabuf;
int xrgb8888_format_found;
};
......@@ -336,10 +336,10 @@ create_window(struct display *display, int width, int height)
xdg_surface_set_title(window->xdg_surface, "simple-dmabuf");
} else if (display->fshell) {
_wl_fullscreen_shell_present_surface(display->fshell,
window->surface,
_WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT,
NULL);
zwp_fullscreen_shell_v1_present_surface(display->fshell,
window->surface,
ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT,
NULL);
} else {
assert(0);
}
......@@ -473,9 +473,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(d->shell, XDG_VERSION);
xdg_shell_add_listener(d->shell, &xdg_shell_listener, d);
} else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
} else if (strcmp(interface, "zwp_fullscreen_shell_v1") == 0) {
d->fshell = wl_registry_bind(registry,
id, &_wl_fullscreen_shell_interface, 1);
id, &zwp_fullscreen_shell_v1_interface, 1);
} else if (strcmp(interface, "zlinux_dmabuf") == 0) {
d->dmabuf = wl_registry_bind(registry,
id, &zlinux_dmabuf_interface, 1);
......@@ -539,7 +539,7 @@ destroy_display(struct display *display)
xdg_shell_destroy(display->shell);
if (display->fshell)
_wl_fullscreen_shell_release(display->fshell);
zwp_fullscreen_shell_v1_release(display->fshell);
if (display->compositor)
wl_compositor_destroy(display->compositor);
......
......@@ -36,7 +36,7 @@
#include <wayland-client.h>
#include "shared/os-compatibility.h"
#include "xdg-shell-client-protocol.h"
#include "fullscreen-shell-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include <sys/types.h>
#include "ivi-application-client-protocol.h"
......@@ -47,7 +47,7 @@ struct display {
struct wl_registry *registry;
struct wl_compositor *compositor;
struct xdg_shell *shell;
struct _wl_fullscreen_shell *fshell;
struct zwp_fullscreen_shell_v1 *fshell;
struct wl_shm *shm;
uint32_t formats;
struct ivi_application *ivi_application;
......@@ -180,10 +180,10 @@ create_window(struct display *display, int width, int height)
xdg_surface_set_title(window->xdg_surface, "simple-shm");
} else if (display->fshell) {
_wl_fullscreen_shell_present_surface(display->fshell,
window->surface,
_WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT,
NULL);
zwp_fullscreen_shell_v1_present_surface(display->fshell,
window->surface,
ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT,
NULL);
} else if (display->ivi_application ) {
uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
window->ivi_surface =
......@@ -374,9 +374,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(d->shell, XDG_VERSION);
xdg_shell_add_listener(d->shell, &xdg_shell_listener, d);
} else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
} else if (strcmp(interface, "zwp_fullscreen_shell_v1") == 0) {
d->fshell = wl_registry_bind(registry,
id, &_wl_fullscreen_shell_interface, 1);
id, &zwp_fullscreen_shell_v1_interface, 1);
} else if (strcmp(interface, "wl_shm") == 0) {
d->shm = wl_registry_bind(registry,
id, &wl_shm_interface, 1);
......@@ -483,7 +483,7 @@ destroy_display(struct display *display)
xdg_shell_destroy(display->shell);
if (display->fshell)
_wl_fullscreen_shell_release(display->fshell);
zwp_fullscreen_shell_v1_release(display->fshell);
if (display->compositor)
wl_compositor_destroy(display->compositor);
......
......@@ -181,6 +181,10 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
[ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
enable_wayland_compositor=yes)
AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
......
......@@ -33,7 +33,7 @@
#include <assert.h>
#include "compositor.h"
#include "fullscreen-shell-server-protocol.h"
#include "fullscreen-shell-unstable-v1-server-protocol.h"
#include "shared/helpers.h"
struct fullscreen_shell {
......@@ -61,7 +61,7 @@ struct fs_output {
struct wl_resource *mode_feedback;
int presented_for_mode;
enum _wl_fullscreen_shell_present_method method;
enum zwp_fullscreen_shell_v1_present_method method;
int32_t framerate;
} pending;
......@@ -72,7 +72,7 @@ struct fs_output {
struct weston_transform transform; /* matrix from x, y */
int presented_for_mode;
enum _wl_fullscreen_shell_present_method method;
enum zwp_fullscreen_shell_v1_present_method method;
uint32_t framerate;
};
......@@ -198,7 +198,7 @@ create_black_surface(struct weston_compositor *ec, struct fs_output *fsout,
static void
fs_output_set_surface(struct fs_output *fsout, struct weston_surface *surface,
enum _wl_fullscreen_shell_present_method method,
enum zwp_fullscreen_shell_v1_present_method method,
int32_t framerate, int presented_for_mode);
static void
fs_output_apply_pending(struct fs_output *fsout);
......@@ -405,12 +405,12 @@ fs_output_configure_simple(struct fs_output *fsout,
surface_aspect = (float) surf_width / (float) surf_height;
switch (fsout->method) {
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT:
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_CENTER:
fs_output_center_view(fsout);
break;
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_ZOOM:
if (output_aspect < surface_aspect)
fs_output_scale_view(fsout,
output->width,
......@@ -421,7 +421,7 @@ fs_output_configure_simple(struct fs_output *fsout,
output->height);
break;
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM_CROP:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_ZOOM_CROP:
if (output_aspect < surface_aspect)
fs_output_scale_view(fsout,
output->height * surface_aspect,
......@@ -432,7 +432,7 @@ fs_output_configure_simple(struct fs_output *fsout,
output->width / surface_aspect);
break;
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_STRETCH:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_STRETCH:
fs_output_scale_view(fsout, output->width, output->height);
break;
default:
......@@ -498,7 +498,7 @@ fs_output_configure_for_mode(struct fs_output *fsout,
/* The mode switch failed. Clear the pending and
* reconfigure as per normal */
if (fsout->pending.mode_feedback) {
_wl_fullscreen_shell_mode_feedback_send_mode_failed(
zwp_fullscreen_shell_mode_feedback_v1_send_mode_failed(
fsout->pending.mode_feedback);
wl_resource_destroy(fsout->pending.mode_feedback);
fsout->pending.mode_feedback = NULL;
......@@ -509,7 +509,7 @@ fs_output_configure_for_mode(struct fs_output *fsout,
}
if (fsout->pending.mode_feedback) {
_wl_fullscreen_shell_mode_feedback_send_mode_successful(
zwp_fullscreen_shell_mode_feedback_v1_send_mode_successful(
fsout->pending.mode_feedback);
wl_resource_destroy(fsout->pending.mode_feedback);
fsout->pending.mode_feedback = NULL;
......@@ -605,7 +605,7 @@ fs_output_clear_pending(struct fs_output *fsout)
return;
if (fsout->pending.mode_feedback) {
_wl_fullscreen_shell_mode_feedback_send_present_cancelled(
zwp_fullscreen_shell_mode_feedback_v1_send_present_cancelled(
fsout->pending.mode_feedback);
wl_resource_destroy(fsout->pending.mode_feedback);
fsout->pending.mode_feedback = NULL;
......@@ -617,7 +617,7 @@ fs_output_clear_pending(struct fs_output *fsout)
static void
fs_output_set_surface(struct fs_output *fsout, struct weston_surface *surface,
enum _wl_fullscreen_shell_present_method method,
enum zwp_fullscreen_shell_v1_present_method method,
int32_t framerate, int presented_for_mode)
{
fs_output_clear_pending(fsout);
......@@ -677,15 +677,15 @@ fullscreen_shell_present_surface(struct wl_client *client,
surface = surface_res ? wl_resource_get_user_data(surface_res) : NULL;
switch(method) {
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT:
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER:
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM:
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM_CROP:
case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_STRETCH:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_CENTER:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_ZOOM:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_ZOOM_CROP:
case ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_STRETCH:
break;
default:
wl_resource_post_error(resource,
_WL_FULLSCREEN_SHELL_ERROR_INVALID_METHOD,
ZWP_FULLSCREEN_SHELL_V1_ERROR_INVALID_METHOD,
"Invalid presentation method");
}
......@@ -745,7 +745,7 @@ fullscreen_shell_present_surface_for_mode(struct wl_client *client,
fsout->pending.mode_feedback =
wl_resource_create(client,
&_wl_fullscreen_shell_mode_feedback_interface,
&zwp_fullscreen_shell_mode_feedback_v1_interface,
1, feedback_id);
wl_resource_set_implementation(fsout->pending.mode_feedback, NULL,
fsout, mode_feedback_destroyed);
......@@ -759,7 +759,7 @@ fullscreen_shell_present_surface_for_mode(struct wl_client *client,
}
}
struct _wl_fullscreen_shell_interface fullscreen_shell_implementation = {
struct zwp_fullscreen_shell_v1_interface fullscreen_shell_implementation = {
fullscreen_shell_release,
fullscreen_shell_present_surface,
fullscreen_shell_present_surface_for_mode,
......@@ -799,19 +799,20 @@ bind_fullscreen_shell(struct wl_client *client, void *data, uint32_t version,
wl_client_add_destroy_listener(client, &shell->client_destroyed);
}
resource = wl_resource_create(client, &_wl_fullscreen_shell_interface,
resource = wl_resource_create(client,
&zwp_fullscreen_shell_v1_interface,
1, id);
wl_resource_set_implementation(resource,
&fullscreen_shell_implementation,
shell, NULL);
if (shell->compositor->capabilities & WESTON_CAP_CURSOR_PLANE)
_wl_fullscreen_shell_send_capability(resource,
_WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE);
zwp_fullscreen_shell_v1_send_capability(resource,
ZWP_FULLSCREEN_SHELL_V1_CAPABILITY_CURSOR_PLANE);
if (shell->compositor->capabilities & WESTON_CAP_ARBITRARY_MODES)
_wl_fullscreen_shell_send_capability(resource,
_WL_FULLSCREEN_SHELL_CAPABILITY_ARBITRARY_MODES);
zwp_fullscreen_shell_v1_send_capability(resource,
ZWP_FULLSCREEN_SHELL_V1_CAPABILITY_ARBITRARY_MODES);
}
WL_EXPORT int
......@@ -846,7 +847,7 @@ module_init(struct weston_compositor *compositor,
seat_created(NULL, seat);
wl_global_create(compositor->wl_display,
&_wl_fullscreen_shell_interface, 1, shell,
&zwp_fullscreen_shell_v1_interface, 1, shell,
bind_fullscreen_shell);
return 0;
......
<protocol name="fullscreen_shell">
<interface name="_wl_fullscreen_shell" version="1">
<description summary="Displays a single surface per output">
Displays a single surface per output.
This interface provides a mechanism for a single client to display
simple full-screen surfaces. While there technically may be multiple
clients bound to this interface, only one of those clients should be
shown at a time.
To present a surface, the client uses either the present_surface or
present_surface_for_mode requests. Presenting a surface takes effect
on the next wl_surface.commit. See the individual requests for
details about scaling and mode switches.
The client can have at most one surface per output at any time.
Requesting a surface be presented on an output that already has a
surface replaces the previously presented surface. Presenting a null
surface removes its content and effectively disables the output.
Exactly what happens when an output is "disabled" is
compositor-specific. The same surface may be presented on multiple
outputs simultaneously.
Once a surface is presented on an output, it stays on that output
until either the client removes it or the compositor destroys the
output. This way, the client can update the output's contents by
simply attaching a new buffer.
</description>
<request name="release" type="destructor">
<description summary="release the wl_fullscreen_shell interface">
Release the binding from the wl_fullscreen_shell interface
This destroys the server-side object and frees this binding. If
the client binds to wl_fullscreen_shell multiple times, it may wish
to free some of those bindings.
</description>
</request>
<enum name="capability">
<description summary="capabilities advertised by the compositor">
Various capabilities that can be advertised by the compositor. They
are advertised one-at-a-time when the wl_fullscreen_shell interface is
bound. See the wl_fullscreen_shell.capability event for more details.
ARBITRARY_MODE:
This is a hint to the client that indicates that the compositor is
capable of setting practically any mode on its outputs. If this
capability is provided, wl_fullscreen_shell.present_surface_for_mode
will almost never fail and clients should feel free to set whatever
mode they like. If the compositor does not advertise this, it may
still support some modes that are not advertised through wl_global.mode
but it is less likely.
CURSOR_PLANE:
This is a hint to the client that indicates that the compositor can
handle a cursor surface from the client without actually compositing.
This may be because of a hardware cursor plane or some other mechanism.
If the compositor does not advertise this capability then setting
wl_pointer.cursor may degrade performance or be ignored entirely. If
CURSOR_PLANE is not advertised, it is recommended that the client draw
its own cursor and set wl_pointer.cursor(NULL).
</description>
<entry name="arbitrary_modes" value="1" summary="compositor is capable of almost any output mode"/>
<entry name="cursor_plane" value="2" summary="compositor has a separate cursor plane"/>
</enum>
<event name="capability">
<description summary="advertises a capability of the compositor">
Advertises a single capability of the compositor.
When the wl_fullscreen_shell interface is bound, this event is emitted
once for each capability advertised. Valid capabilities are given by
the wl_fullscreen_shell.capability enum. If clients want to take
advantage of any of these capabilities, they should use a
wl_display.sync request immediately after binding to ensure that they
receive all the capability events.
</description>
<arg name="capabilty" type="uint"/>
</event>
<enum name="present_method">
<description summary="different method to set the surface fullscreen">
Hints to indicate to the compositor how to deal with a conflict
between the dimensions of the surface and the dimensions of the
output. The compositor is free to ignore this parameter.
</description>
<entry name="default" value="0" summary="no preference, apply default policy"/>
<entry name="center" value="1" summary="center the surface on the output"/>
<entry name="zoom" value="2" summary="scale the surface, preserving aspect ratio, to the largest size that will fit on the output" />
<entry name="zoom_crop" value="3" summary="scale the surface, preserving aspect ratio, to fully fill the output cropping if needed" />
<entry name="stretch" value="4" summary="scale the surface to the size of the output ignoring aspect ratio" />
</enum>
<request name="present_surface">
<description summary="present surface for display">
Present a surface on the given output.
If the output is null, the compositor will present the surface on
whatever display (or displays) it thinks best. In particular, this
may replace any or all surfaces currently presented so it should
not be used in combination with placing surfaces on specific
outputs.
The method parameter is a hint to the compositor for how the surface
is to be presented. In particular, it tells the compositor how to
handle a size mismatch between the presented surface and the
output. The compositor is free to ignore this parameter.