Commit 9037ba73 authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Adam Jackson

xwayland: Bind the relative pointer manager

Will be used for getting unaccelerated motion events and later for
relative motions used by a pointer warp emulator.
Signed-off-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 0fae3be0
......@@ -2533,7 +2533,7 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
dnl Xwayland DDX
XWAYLANDMODULES="wayland-client >= 1.3.0 libdrm epoxy"
XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 libdrm epoxy"
if test "x$XF86VIDMODE" = xyes; then
XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
fi
......@@ -2562,6 +2562,8 @@ if test "x$XWAYLAND" = xyes; then
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
[${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
fi
......
Xwayland
drm-client-protocol.h
drm-protocol.c
relative-pointer-unstable-v1-client-protocol.h
relative-pointer-unstable-v1-protocol.c
......@@ -30,6 +30,7 @@ Xwayland_LDADD = \
$(XSERVER_SYS_LIBS)
Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
Xwayland_built_sources =
if GLAMOR_EGL
Xwayland_SOURCES += \
......@@ -39,13 +40,11 @@ Xwayland_SOURCES += \
xwayland-glamor-xv.c
endif
nodist_Xwayland_SOURCES = \
glamor_built_sources = \
drm-client-protocol.h \
drm-protocol.c
CLEANFILES = $(nodist_Xwayland_SOURCES)
xwayland-glamor.c : $(nodist_Xwayland_SOURCES)
Xwayland_built_sources += $(glamor_built_sources)
glamor_lib = $(top_builddir)/glamor/libglamor.la
......@@ -53,12 +52,26 @@ Xwayland_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL
Xwayland_DEPENDENCIES = $(glamor_lib) $(XWAYLAND_LIBS)
endif
Xwayland_built_sources += \
relative-pointer-unstable-v1-client-protocol.h \
relative-pointer-unstable-v1-protocol.c
nodist_Xwayland_SOURCES = $(Xwayland_built_sources)
CLEANFILES = $(Xwayland_built_sources)
EXTRA_DIST = drm.xml
$(Xwayland_SOURCES): $(Xwayland_built_sources)
relink:
$(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT)
relative-pointer-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
relative-pointer-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
%-protocol.c : %.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
......
......@@ -905,6 +905,16 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat)
free(xwl_seat);
}
static void
init_relative_pointer_manager(struct xwl_screen *xwl_screen,
uint32_t id, uint32_t version)
{
xwl_screen->relative_pointer_manager =
wl_registry_bind(xwl_screen->registry, id,
&zwp_relative_pointer_manager_v1_interface,
1);
}
static void
input_handler(void *data, struct wl_registry *registry, uint32_t id,
const char *interface, uint32_t version)
......@@ -914,6 +924,8 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id,
if (strcmp(interface, "wl_seat") == 0 && version >= 3) {
create_input_device(xwl_screen, id, version);
xwl_screen->expecting_event++;
} else if (strcmp(interface, "zwp_relative_pointer_manager_v1") == 0) {
init_relative_pointer_manager(xwl_screen, id, version);
}
}
......
......@@ -42,6 +42,8 @@
#include <randrstr.h>
#include <exevents.h>
#include "relative-pointer-unstable-v1-client-protocol.h"
struct xwl_screen {
int width;
int height;
......@@ -75,6 +77,7 @@ struct xwl_screen {
struct wl_compositor *compositor;
struct wl_shm *shm;
struct wl_shell *shell;
struct zwp_relative_pointer_manager_v1 *relative_pointer_manager;
uint32_t serial;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment