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 <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
0fae3be068
commit
9037ba736a
|
@ -2533,7 +2533,7 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
|
||||||
|
|
||||||
dnl Xwayland DDX
|
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
|
if test "x$XF86VIDMODE" = xyes; then
|
||||||
XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
|
XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
|
||||||
fi
|
fi
|
||||||
|
@ -2562,6 +2562,8 @@ if test "x$XWAYLAND" = xyes; then
|
||||||
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
|
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
|
||||||
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
|
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
|
||||||
[${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
|
[${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
|
||||||
|
|
||||||
|
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
Xwayland
|
Xwayland
|
||||||
drm-client-protocol.h
|
drm-client-protocol.h
|
||||||
drm-protocol.c
|
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)
|
$(XSERVER_SYS_LIBS)
|
||||||
Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
|
Xwayland_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
|
||||||
|
|
||||||
|
Xwayland_built_sources =
|
||||||
|
|
||||||
if GLAMOR_EGL
|
if GLAMOR_EGL
|
||||||
Xwayland_SOURCES += \
|
Xwayland_SOURCES += \
|
||||||
|
@ -39,13 +40,11 @@ Xwayland_SOURCES += \
|
||||||
xwayland-glamor-xv.c
|
xwayland-glamor-xv.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
nodist_Xwayland_SOURCES = \
|
glamor_built_sources = \
|
||||||
drm-client-protocol.h \
|
drm-client-protocol.h \
|
||||||
drm-protocol.c
|
drm-protocol.c
|
||||||
|
|
||||||
CLEANFILES = $(nodist_Xwayland_SOURCES)
|
Xwayland_built_sources += $(glamor_built_sources)
|
||||||
|
|
||||||
xwayland-glamor.c : $(nodist_Xwayland_SOURCES)
|
|
||||||
|
|
||||||
glamor_lib = $(top_builddir)/glamor/libglamor.la
|
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)
|
Xwayland_DEPENDENCIES = $(glamor_lib) $(XWAYLAND_LIBS)
|
||||||
endif
|
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
|
EXTRA_DIST = drm.xml
|
||||||
|
|
||||||
|
|
||||||
|
$(Xwayland_SOURCES): $(Xwayland_built_sources)
|
||||||
|
|
||||||
relink:
|
relink:
|
||||||
$(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT)
|
$(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
|
%-protocol.c : %.xml
|
||||||
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
|
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
|
||||||
|
|
||||||
|
|
|
@ -905,6 +905,16 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat)
|
||||||
free(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
|
static void
|
||||||
input_handler(void *data, struct wl_registry *registry, uint32_t id,
|
input_handler(void *data, struct wl_registry *registry, uint32_t id,
|
||||||
const char *interface, uint32_t version)
|
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) {
|
if (strcmp(interface, "wl_seat") == 0 && version >= 3) {
|
||||||
create_input_device(xwl_screen, id, version);
|
create_input_device(xwl_screen, id, version);
|
||||||
xwl_screen->expecting_event++;
|
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 <randrstr.h>
|
||||||
#include <exevents.h>
|
#include <exevents.h>
|
||||||
|
|
||||||
|
#include "relative-pointer-unstable-v1-client-protocol.h"
|
||||||
|
|
||||||
struct xwl_screen {
|
struct xwl_screen {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
@ -75,6 +77,7 @@ struct xwl_screen {
|
||||||
struct wl_compositor *compositor;
|
struct wl_compositor *compositor;
|
||||||
struct wl_shm *shm;
|
struct wl_shm *shm;
|
||||||
struct wl_shell *shell;
|
struct wl_shell *shell;
|
||||||
|
struct zwp_relative_pointer_manager_v1 *relative_pointer_manager;
|
||||||
|
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue