libweston-desktop: Implement xdg_shell_v6

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Giulio Camuffo <giulio.camuffo@kdab.com>

Differential Revision: https://phabricator.freedesktop.org/D1210
dev
Quentin Glidic 8 years ago committed by Jonas Ådahl
parent 5ac91a15e8
commit 9c5dd7ef70
  1. 4
      Makefile.am
  2. 2
      configure.ac
  3. 10
      libweston-desktop/libweston-desktop.c
  4. 1235
      libweston-desktop/xdg-shell-v6.c
  5. 6
      libweston/compositor.c
  6. 2
      libweston/compositor.h

@ -119,15 +119,19 @@ libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES = \
libweston-desktop/seat.c \ libweston-desktop/seat.c \
libweston-desktop/surface.c \ libweston-desktop/surface.c \
libweston-desktop/wl-shell.c \ libweston-desktop/wl-shell.c \
libweston-desktop/xdg-shell-v6.c \
libweston-desktop/xdg-shell-v5.c \ libweston-desktop/xdg-shell-v5.c \
libweston-desktop/xwayland.c libweston-desktop/xwayland.c
nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES = \ nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-server-protocol.h \
protocol/xdg-shell-unstable-v5-protocol.c \ protocol/xdg-shell-unstable-v5-protocol.c \
protocol/xdg-shell-unstable-v5-server-protocol.h protocol/xdg-shell-unstable-v5-server-protocol.h
BUILT_SOURCES += $(nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES) BUILT_SOURCES += $(nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES)
libweston-desktop-@LIBWESTON_MAJOR@.la libweston-desktop/libweston_desktop_@LIBWESTON_MAJOR@_la-xdg-shell-v6.lo: protocol/xdg-shell-unstable-v6-server-protocol.h
libweston-desktop-@LIBWESTON_MAJOR@.la libweston-desktop/libweston_desktop_@LIBWESTON_MAJOR@_la-xdg-shell-v5.lo: protocol/xdg-shell-unstable-v5-server-protocol.h libweston-desktop-@LIBWESTON_MAJOR@.la libweston-desktop/libweston_desktop_@LIBWESTON_MAJOR@_la-xdg-shell-v5.lo: protocol/xdg-shell-unstable-v5-server-protocol.h
if SYSTEMD_NOTIFY_SUPPORT if SYSTEMD_NOTIFY_SUPPORT

@ -194,7 +194,7 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0]) PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES]) PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.4], PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.7],
[ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`]) [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir) AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)

@ -40,6 +40,7 @@ struct weston_desktop {
struct weston_compositor *compositor; struct weston_compositor *compositor;
struct weston_desktop_api api; struct weston_desktop_api api;
void *user_data; void *user_data;
struct wl_global *xdg_shell_v6;
struct wl_global *xdg_shell_v5; struct wl_global *xdg_shell_v5;
struct wl_global *wl_shell; struct wl_global *wl_shell;
}; };
@ -69,6 +70,13 @@ weston_desktop_create(struct weston_compositor *compositor,
MIN(sizeof(struct weston_desktop_api), api->struct_size); MIN(sizeof(struct weston_desktop_api), api->struct_size);
memcpy(&desktop->api, api, desktop->api.struct_size); memcpy(&desktop->api, api, desktop->api.struct_size);
desktop->xdg_shell_v6 =
weston_desktop_xdg_shell_v6_create(desktop, display);
if (desktop->xdg_shell_v6 == NULL) {
weston_desktop_destroy(desktop);
return NULL;
}
desktop->xdg_shell_v5 = desktop->xdg_shell_v5 =
weston_desktop_xdg_shell_v5_create(desktop, display); weston_desktop_xdg_shell_v5_create(desktop, display);
if (desktop->xdg_shell_v5 == NULL) { if (desktop->xdg_shell_v5 == NULL) {
@ -98,6 +106,8 @@ weston_desktop_destroy(struct weston_desktop *desktop)
wl_global_destroy(desktop->wl_shell); wl_global_destroy(desktop->wl_shell);
if (desktop->xdg_shell_v5 != NULL) if (desktop->xdg_shell_v5 != NULL)
wl_global_destroy(desktop->xdg_shell_v5); wl_global_destroy(desktop->xdg_shell_v5);
if (desktop->xdg_shell_v6 != NULL)
wl_global_destroy(desktop->xdg_shell_v6);
free(desktop); free(desktop);
} }

File diff suppressed because it is too large Load Diff

@ -3344,6 +3344,12 @@ weston_surface_set_role(struct weston_surface *surface,
return -1; return -1;
} }
WL_EXPORT const char *
weston_surface_get_role(struct weston_surface *surface)
{
return surface->role_name;
}
WL_EXPORT void WL_EXPORT void
weston_surface_set_label_func(struct weston_surface *surface, weston_surface_set_label_func(struct weston_surface *surface,
int (*desc)(struct weston_surface *, int (*desc)(struct weston_surface *,

@ -1526,6 +1526,8 @@ weston_surface_set_role(struct weston_surface *surface,
const char *role_name, const char *role_name,
struct wl_resource *error_resource, struct wl_resource *error_resource,
uint32_t error_code); uint32_t error_code);
const char *
weston_surface_get_role(struct weston_surface *surface);
void void
weston_surface_set_label_func(struct weston_surface *surface, weston_surface_set_label_func(struct weston_surface *surface,

Loading…
Cancel
Save