diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h index 76c12c13..57f3439b 100644 --- a/common/xrdp_constants.h +++ b/common/xrdp_constants.h @@ -201,6 +201,11 @@ #define PTRFLAGS_BUTTON2 0x2000 #define PTRFLAGS_BUTTON3 0x4000 +/* Mouse Event (MS-RDPBCGR 2.2.8.1.1.3.1.1.4) */ +#define PTRXFLAGS_DOWN 0x8000 +#define PTRXFLAGS_BUTTON1 0x0001 +#define PTRXFLAGS_BUTTON2 0x0002 + /* Raster operation masks */ #define ROP2_S(rop3) (rop3 & 0xf) #define ROP2_P(rop3) ((rop3 & 0x3) | ((rop3 & 0x30) >> 2)) diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index 7379979d..3d16fe63 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -1722,24 +1722,24 @@ static int xrdp_wm_process_input_mousex(struct xrdp_wm* self, int device_flags, int x, int y) { - if (device_flags & 0x8000) /* PTRXFLAGS_DOWN */ + if (device_flags & PTRXFLAGS_DOWN) { - if (device_flags & 0x0001) /* PTRXFLAGS_BUTTON1 */ + if (device_flags & PTRXFLAGS_BUTTON1) { xrdp_wm_mouse_click(self, x, y, 6, 1); } - else if (device_flags & 0x0002) /* PTRXFLAGS_BUTTON2 */ + else if (device_flags & PTRXFLAGS_BUTTON2) { xrdp_wm_mouse_click(self, x, y, 7, 1); } } else { - if (device_flags & 0x0001) /* PTRXFLAGS_BUTTON1 */ + if (device_flags & PTRXFLAGS_BUTTON1) { xrdp_wm_mouse_click(self, x, y, 6, 0); } - else if (device_flags & 0x0002) /* PTRXFLAGS_BUTTON2 */ + else if (device_flags & PTRXFLAGS_BUTTON2) { xrdp_wm_mouse_click(self, x, y, 7, 0); }