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 <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Jonas Ådahl
2015-11-17 16:00:27 +08:00
committed by Pekka Paalanen
parent 4bcc54d1a5
commit 496adb3bb3
10 changed files with 164 additions and 353 deletions
+29 -29
View File
@@ -46,7 +46,7 @@
#include "shared/image-loader.h"
#include "shared/os-compatibility.h"
#include "shared/cairo-util.h"
#include "fullscreen-shell-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "presentation_timing-server-protocol.h"
#include "linux-dmabuf.h"
@@ -61,7 +61,7 @@ struct wayland_backend {
struct wl_registry *registry;
struct wl_compositor *compositor;
struct wl_shell *shell;
struct _wl_fullscreen_shell *fshell;
struct zwp_fullscreen_shell_v1 *fshell;
struct wl_shm *shm;
struct wl_list output_list;
@@ -813,9 +813,9 @@ wayland_output_set_fullscreen(struct wayland_output *output,
wl_shell_surface_set_fullscreen(output->parent.shell_surface,
method, framerate, target);
} else if (b->parent.fshell) {
_wl_fullscreen_shell_present_surface(b->parent.fshell,
output->parent.surface,
method, target);
zwp_fullscreen_shell_v1_present_surface(b->parent.fshell,
output->parent.surface,
method, target);
}
}
@@ -851,7 +851,7 @@ enum mode_status {
static void
mode_feedback_successful(void *data,
struct _wl_fullscreen_shell_mode_feedback *fb)
struct zwp_fullscreen_shell_mode_feedback_v1 *fb)
{
enum mode_status *value = data;
@@ -861,7 +861,7 @@ mode_feedback_successful(void *data,
}
static void
mode_feedback_failed(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
mode_feedback_failed(void *data, struct zwp_fullscreen_shell_mode_feedback_v1 *fb)
{
enum mode_status *value = data;
@@ -871,7 +871,7 @@ mode_feedback_failed(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
}
static void
mode_feedback_cancelled(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
mode_feedback_cancelled(void *data, struct zwp_fullscreen_shell_mode_feedback_v1 *fb)
{
enum mode_status *value = data;
@@ -880,7 +880,7 @@ mode_feedback_cancelled(void *data, struct _wl_fullscreen_shell_mode_feedback *f
*value = MODE_STATUS_CANCEL;
}
struct _wl_fullscreen_shell_mode_feedback_listener mode_feedback_listener = {
struct zwp_fullscreen_shell_mode_feedback_v1_listener mode_feedback_listener = {
mode_feedback_successful,
mode_feedback_failed,
mode_feedback_cancelled,
@@ -894,7 +894,7 @@ wayland_output_switch_mode(struct weston_output *output_base,
struct wayland_backend *b;
struct wl_surface *old_surface;
struct weston_mode *old_mode;
struct _wl_fullscreen_shell_mode_feedback *mode_feedback;
struct zwp_fullscreen_shell_mode_feedback_v1 *mode_feedback;
enum mode_status mode_status;
int ret = 0;
@@ -931,13 +931,13 @@ wayland_output_switch_mode(struct weston_output *output_base,
wayland_output_resize_surface(output);
mode_feedback =
_wl_fullscreen_shell_present_surface_for_mode(b->parent.fshell,
output->parent.surface,
output->parent.output,
mode->refresh);
_wl_fullscreen_shell_mode_feedback_add_listener(mode_feedback,
&mode_feedback_listener,
&mode_status);
zwp_fullscreen_shell_v1_present_surface_for_mode(b->parent.fshell,
output->parent.surface,
output->parent.output,
mode->refresh);
zwp_fullscreen_shell_mode_feedback_v1_add_listener(mode_feedback,
&mode_feedback_listener,
&mode_status);
/* This should kick-start things again */
output->parent.draw_initial_frame = 1;
@@ -947,7 +947,7 @@ wayland_output_switch_mode(struct weston_output *output_base,
while (mode_status == MODE_STATUS_UNKNOWN && ret >= 0)
ret = wl_display_dispatch(b->parent.wl_display);
_wl_fullscreen_shell_mode_feedback_destroy(mode_feedback);
zwp_fullscreen_shell_mode_feedback_v1_destroy(mode_feedback);
if (mode_status == MODE_STATUS_FAIL) {
output->base.current_mode = old_mode;
@@ -1194,15 +1194,15 @@ wayland_output_create_for_parent_output(struct wayland_backend *b,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER,
mode->refresh, poutput->global);
} else if (b->parent.fshell) {
_wl_fullscreen_shell_present_surface(b->parent.fshell,
output->parent.surface,
_WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER,
poutput->global);
_wl_fullscreen_shell_mode_feedback_destroy(
_wl_fullscreen_shell_present_surface_for_mode(b->parent.fshell,
output->parent.surface,
poutput->global,
mode->refresh));
zwp_fullscreen_shell_v1_present_surface(b->parent.fshell,
output->parent.surface,
ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_CENTER,
poutput->global);
zwp_fullscreen_shell_mode_feedback_v1_destroy(
zwp_fullscreen_shell_v1_present_surface_for_mode(b->parent.fshell,
output->parent.surface,
poutput->global,
mode->refresh));
}
return output;
@@ -1819,10 +1819,10 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
b->parent.shell =
wl_registry_bind(registry, name,
&wl_shell_interface, 1);
} else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
} else if (strcmp(interface, "zwp_fullscreen_shell_v1") == 0) {
b->parent.fshell =
wl_registry_bind(registry, name,
&_wl_fullscreen_shell_interface, 1);
&zwp_fullscreen_shell_v1_interface, 1);
} else if (strcmp(interface, "wl_seat") == 0) {
display_add_seat(b, name, version);
} else if (strcmp(interface, "wl_output") == 0) {
+19 -17
View File
@@ -42,7 +42,7 @@
#include "compositor.h"
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
#include "fullscreen-shell-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
struct shared_output {
struct weston_output *output;
@@ -55,11 +55,11 @@ struct shared_output {
struct wl_compositor *compositor;
struct wl_shm *shm;
uint32_t shm_formats;
struct _wl_fullscreen_shell *fshell;
struct zwp_fullscreen_shell_v1 *fshell;
struct wl_output *output;
struct wl_surface *surface;
struct wl_callback *frame_cb;
struct _wl_fullscreen_shell_mode_feedback *mode_feedback;
struct zwp_fullscreen_shell_mode_feedback_v1 *mode_feedback;
} parent;
struct wl_event_source *event_source;
@@ -697,10 +697,12 @@ registry_handle_global(void *data, struct wl_registry *registry,
wl_registry_bind(registry,
id, &wl_shm_interface, 1);
wl_shm_add_listener(so->parent.shm, &shm_listener, so);
} else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
} else if (strcmp(interface, "zwp_fullscreen_shell_v1") == 0) {
so->parent.fshell =
wl_registry_bind(registry,
id, &_wl_fullscreen_shell_interface, 1);
id,
&zwp_fullscreen_shell_v1_interface,
1);
}
}
@@ -750,25 +752,25 @@ output_destroyed(struct wl_listener *l, void *data)
}
static void
mode_feedback_ok(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
mode_feedback_ok(void *data, struct zwp_fullscreen_shell_mode_feedback_v1 *fb)
{
struct shared_output *so = data;
_wl_fullscreen_shell_mode_feedback_destroy(so->parent.mode_feedback);
zwp_fullscreen_shell_mode_feedback_v1_destroy(so->parent.mode_feedback);
}
static void
mode_feedback_failed(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
mode_feedback_failed(void *data, struct zwp_fullscreen_shell_mode_feedback_v1 *fb)
{
struct shared_output *so = data;
_wl_fullscreen_shell_mode_feedback_destroy(so->parent.mode_feedback);
zwp_fullscreen_shell_mode_feedback_v1_destroy(so->parent.mode_feedback);
weston_log("Screen share failed: present_surface_for_mode failed\n");
shared_output_destroy(so);
}
struct _wl_fullscreen_shell_mode_feedback_listener mode_feedback_listener = {
struct zwp_fullscreen_shell_mode_feedback_v1_listener mode_feedback_listener = {
mode_feedback_ok,
mode_feedback_failed,
mode_feedback_ok,
@@ -919,17 +921,17 @@ shared_output_create(struct weston_output *output, int parent_fd)
}
so->parent.mode_feedback =
_wl_fullscreen_shell_present_surface_for_mode(so->parent.fshell,
so->parent.surface,
so->parent.output,
output->current_mode->refresh);
zwp_fullscreen_shell_v1_present_surface_for_mode(so->parent.fshell,
so->parent.surface,
so->parent.output,
output->current_mode->refresh);
if (!so->parent.mode_feedback) {
weston_log("Screen share failed: %m\n");
goto err_display;
}
_wl_fullscreen_shell_mode_feedback_add_listener(so->parent.mode_feedback,
&mode_feedback_listener,
so);
zwp_fullscreen_shell_mode_feedback_v1_add_listener(so->parent.mode_feedback,
&mode_feedback_listener,
so);
loop = wl_display_get_event_loop(output->compositor->wl_display);