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:
committed by
Pekka Paalanen
parent
4bcc54d1a5
commit
496adb3bb3
+30
-30
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user