Commit 7d34b1f2 authored by Simon Ser's avatar Simon Ser Committed by Povilas Kanapickas
Browse files

xwayland: add -noTouchPointerEmulation



In some scenarios, the Wayland compositor might have more knowledge
than the X11 server and may be able to perform pointer emulation for
touch events better. Add a command-line switch to allow compositors
to turn Xwayland pointer emulation off.
Signed-off-by: Simon Ser's avatarSimon Ser <contact@emersion.fr>
parent 7c63c582
Pipeline #396103 passed with stages
in 7 minutes and 14 seconds
......@@ -42,6 +42,8 @@
#define TOUCH_HISTORY_SIZE 100
Bool touchEmulatePointer = TRUE;
/**
* Some documentation about touch points:
* The driver submits touch events with its own (unique) touch point ID.
......@@ -142,7 +144,7 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id)
if (!t)
return NULL;
emulate_pointer = (t->mode == XIDirectTouch);
emulate_pointer = touchEmulatePointer && (t->mode == XIDirectTouch);
/* Look for another active touchpoint with the same DDX ID. DDX
* touchpoints must be unique. */
......
......@@ -66,6 +66,11 @@ deprecated, use \fI\-listenfd\fP instead.
Add given fd as a listen socket. This option is used by the \fIWayland\fP
server to pass \fIXwayland\fP the socket where X clients connect.
.TP 8
.B \-noTouchPointerEmulation
Disable touch pointer emulation. This allows the Wayland compositor to
implement its own pointer emulation mechanism for X11 clients that don't
support touch input.
.TP 8
.B \-rootless
Run \fIXwayland\fP rootless, so that X clients integrate seamlessly with
Wayland clients in a Wayland desktop. That requires the Wayland server
......
......@@ -95,6 +95,7 @@ ddxUseMsg(void)
ErrorF("-shm use shared memory for passing buffers\n");
ErrorF("-verbose [n] verbose startup messages\n");
ErrorF("-version show the server version and exit\n");
ErrorF("-noTouchPointerEmulation disable touch pointer emulation\n");
}
static int init_fd = -1;
......@@ -185,6 +186,9 @@ ddxProcessArgument(int argc, char *argv[], int i)
xwl_show_version();
exit(0);
}
else if (strcmp(argv[i], "-noTouchPointerEmulation") == 0) {
touchEmulatePointer = FALSE;
}
return 0;
}
......
......@@ -11,3 +11,4 @@ have_initfd=true
have_listenfd=true
have_verbose=true
have_terminate_delay=true
have_no_touch_pointer_emulation=true
......@@ -147,6 +147,7 @@ extern _X_EXPORT ClientPtr serverClient;
extern _X_EXPORT int currentMaxClients;
extern _X_EXPORT char dispatchExceptionAtReset;
extern _X_EXPORT int terminateDelay;
extern _X_EXPORT Bool touchEmulatePointer;
typedef int HWEventQueueType;
typedef HWEventQueueType *HWEventQueuePtr;
......
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