From b569293367a7f6406ff37c1c2ace39829a656b3d Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:22:07 +0000 Subject: [PATCH] Set up alternative definitions for some window messages FreeRDP silently redefines WM_LBUTTONUP, WM_LBUTTONDOWN, WM_RBUTTONUP and WM_RBUTTONDOWN. This fixes a regression introduced by #2864 --- common/xrdp_constants.h | 6 ++++++ neutrinordp/xrdp-neutrinordp.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h index 231d494ab9..809ede4c53 100644 --- a/common/xrdp_constants.h +++ b/common/xrdp_constants.h @@ -263,6 +263,12 @@ #define WM_LBUTTONDOWN 102 #define WM_RBUTTONUP 103 #define WM_RBUTTONDOWN 104 +/* Alternative definitions needed for buttons 1 and 2 - + * FreeRDP silently redefines the above ones */ +#define WM_BUTTON1UP 101 +#define WM_BUTTON1DOWN 102 +#define WM_BUTTON2UP 103 +#define WM_BUTTON2DOWN 104 #define WM_BUTTON3UP 105 #define WM_BUTTON3DOWN 106 #define WM_BUTTON4UP 107 diff --git a/neutrinordp/xrdp-neutrinordp.c b/neutrinordp/xrdp-neutrinordp.c index 859b29b586..23a45e632d 100644 --- a/neutrinordp/xrdp-neutrinordp.c +++ b/neutrinordp/xrdp-neutrinordp.c @@ -359,7 +359,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2, mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; - case WM_LBUTTONUP: + case WM_BUTTON1UP: LOG_DEVEL(LOG_LEVEL_DEBUG, "left button up %ld %ld", param1, param2); x = param1; y = param2; @@ -367,7 +367,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2, mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; - case WM_LBUTTONDOWN: + case WM_BUTTON1DOWN: LOG_DEVEL(LOG_LEVEL_DEBUG, "left button down %ld %ld", param1, param2); x = param1; y = param2; @@ -375,7 +375,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2, mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; - case WM_RBUTTONUP: + case WM_BUTTON2UP: LOG_DEVEL(LOG_LEVEL_DEBUG, "right button up %ld %ld", param1, param2); x = param1; y = param2; @@ -383,7 +383,7 @@ lxrdp_event(struct mod *mod, int msg, long param1, long param2, mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; - case WM_RBUTTONDOWN: + case WM_BUTTON2DOWN: LOG_DEVEL(LOG_LEVEL_DEBUG, "right button down %ld %ld", param1, param2); x = param1; y = param2;