Merge pull request #2425 from seflerZ/touchpad

Disable touch events on XVNC session
This commit is contained in:
matt335672 2022-11-21 10:02:53 +00:00 committed by GitHub
commit b0ab1c8529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 11 deletions

View File

@ -56,11 +56,6 @@ xrdp_mm_chansrv_connect(struct xrdp_mm *self, const char *port);
static void
xrdp_mm_connect_sm(struct xrdp_mm *self);
/* Code values used in 'code=' settings */
#define XVNC_SESSION_CODE 0
#define XRDP_SESSION_CODE 10
#define XORG_SESSION_CODE 20
/*****************************************************************************/
struct xrdp_mm *
xrdp_mm_create(struct xrdp_wm *owner)

View File

@ -32,6 +32,14 @@
#define MAX_NR_CHANNELS 16
#define MAX_CHANNEL_NAME 16
/* Code values used in 'xrdp_mm->code=' settings */
#define XVNC_SESSION_CODE 0
#define XRDP_SESSION_CODE 10
#define XORG_SESSION_CODE 20
/* To check whether touch events has been implemented on session type 'mm' */
#define XRDP_MM_IMPLEMENTS_TOUCH(mm) ((mm)->code != XVNC_SESSION_CODE)
struct source_info;
/* lib */

View File

@ -29,8 +29,6 @@
#include "log.h"
#include "string_calls.h"
/*****************************************************************************/
struct xrdp_wm *
xrdp_wm_create(struct xrdp_process *owner,
@ -1813,7 +1811,7 @@ xrdp_wm_process_input_mouse(struct xrdp_wm *self, int device_flags,
* The negative number is represented by complement.
*/
delta = (device_flags & WheelRotationMask) | ~WheelRotationMask;
if (delta != 0)
if (delta != 0 && XRDP_MM_IMPLEMENTS_TOUCH(self->mm))
{
// Use nature scrolling, up direction is negative.
xrdp_wm_mouse_touch(self, TOUCH_TWO_FINGERS_UP, delta);
@ -1826,7 +1824,7 @@ xrdp_wm_process_input_mouse(struct xrdp_wm *self, int device_flags,
else
{
delta = device_flags & WheelRotationMask;
if (delta != 0)
if (delta != 0 && XRDP_MM_IMPLEMENTS_TOUCH(self->mm))
{
xrdp_wm_mouse_touch(self, TOUCH_TWO_FINGERS_DOWN, delta);
}
@ -1859,7 +1857,7 @@ xrdp_wm_process_input_mouse(struct xrdp_wm *self, int device_flags,
* The negative number is represented by complement.
*/
delta = (device_flags & WheelRotationMask) | ~WheelRotationMask;
if (delta != 0)
if (delta != 0 && XRDP_MM_IMPLEMENTS_TOUCH(self->mm))
{
// Use nature scrolling, right direction is negative.
xrdp_wm_mouse_touch(self, TOUCH_TWO_FINGERS_RIGHT, delta);
@ -1872,7 +1870,7 @@ xrdp_wm_process_input_mouse(struct xrdp_wm *self, int device_flags,
else
{
delta = device_flags & WheelRotationMask;
if (delta != 0)
if (delta != 0 && XRDP_MM_IMPLEMENTS_TOUCH(self->mm))
{
xrdp_wm_mouse_touch(self, TOUCH_TWO_FINGERS_LEFT, delta);
}