mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
Use client/common mouse functions
This commit is contained in:
parent
4d3157c9cc
commit
700d6dcd9e
@ -318,7 +318,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
NSPoint loc = [event locationInWindow];
|
||||
int x = (int)loc.x;
|
||||
int y = (int)loc.y;
|
||||
mf_scale_mouse_event(context, instance->input, PTR_FLAGS_MOVE, x, y);
|
||||
mf_scale_mouse_event(context, PTR_FLAGS_MOVE, x, y);
|
||||
}
|
||||
|
||||
- (void)mouseDown:(NSEvent *)event
|
||||
@ -331,7 +331,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
NSPoint loc = [event locationInWindow];
|
||||
int x = (int)loc.x;
|
||||
int y = (int)loc.y;
|
||||
mf_press_mouse_button(context, instance->input, 0, x, y, TRUE);
|
||||
mf_press_mouse_button(context, 0, x, y, TRUE);
|
||||
}
|
||||
|
||||
- (void)mouseUp:(NSEvent *)event
|
||||
@ -344,7 +344,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
NSPoint loc = [event locationInWindow];
|
||||
int x = (int)loc.x;
|
||||
int y = (int)loc.y;
|
||||
mf_press_mouse_button(context, instance->input, 0, x, y, FALSE);
|
||||
mf_press_mouse_button(context, 0, x, y, FALSE);
|
||||
}
|
||||
|
||||
- (void)rightMouseDown:(NSEvent *)event
|
||||
@ -357,7 +357,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
NSPoint loc = [event locationInWindow];
|
||||
int x = (int)loc.x;
|
||||
int y = (int)loc.y;
|
||||
mf_press_mouse_button(context, instance->input, 1, x, y, TRUE);
|
||||
mf_press_mouse_button(context, 1, x, y, TRUE);
|
||||
}
|
||||
|
||||
- (void)rightMouseUp:(NSEvent *)event
|
||||
@ -370,7 +370,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
NSPoint loc = [event locationInWindow];
|
||||
int x = (int)loc.x;
|
||||
int y = (int)loc.y;
|
||||
mf_press_mouse_button(context, instance->input, 1, x, y, FALSE);
|
||||
mf_press_mouse_button(context, 1, x, y, FALSE);
|
||||
}
|
||||
|
||||
- (void)otherMouseDown:(NSEvent *)event
|
||||
@ -384,7 +384,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
int x = (int)loc.x;
|
||||
int y = (int)loc.y;
|
||||
int pressed = [event buttonNumber];
|
||||
mf_press_mouse_button(context, instance->input, pressed, x, y, TRUE);
|
||||
mf_press_mouse_button(context, pressed, x, y, TRUE);
|
||||
}
|
||||
|
||||
- (void)otherMouseUp:(NSEvent *)event
|
||||
@ -398,7 +398,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
int x = (int)loc.x;
|
||||
int y = (int)loc.y;
|
||||
int pressed = [event buttonNumber];
|
||||
mf_press_mouse_button(context, instance->input, pressed, x, y, FALSE);
|
||||
mf_press_mouse_button(context, pressed, x, y, FALSE);
|
||||
}
|
||||
|
||||
- (void)scrollWheel:(NSEvent *)event
|
||||
@ -447,7 +447,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
|
||||
step = 0x100 - step;
|
||||
|
||||
mf_scale_mouse_event(context, instance->input, flags | step, 0, 0);
|
||||
mf_scale_mouse_event(context, flags | step, 0, 0);
|
||||
}
|
||||
|
||||
- (void)mouseDragged:(NSEvent *)event
|
||||
@ -461,7 +461,7 @@ DWORD WINAPI mac_client_thread(void *param)
|
||||
int x = (int)loc.x;
|
||||
int y = (int)loc.y;
|
||||
// send mouse motion event to RDP server
|
||||
mf_scale_mouse_event(context, instance->input, PTR_FLAGS_MOVE, x, y);
|
||||
mf_scale_mouse_event(context, PTR_FLAGS_MOVE, x, y);
|
||||
}
|
||||
|
||||
DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
|
||||
|
@ -29,12 +29,9 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
FREERDP_API void mf_press_mouse_button(void* context, rdpInput* intput, int button, int x,
|
||||
int y, BOOL down);
|
||||
FREERDP_API void mf_scale_mouse_event(void* context, rdpInput* input, UINT16 flags, UINT16 x,
|
||||
UINT16 y);
|
||||
FREERDP_API void mf_scale_mouse_event_ex(void* context, rdpInput* input, UINT16 flags, UINT16 x,
|
||||
UINT16 y);
|
||||
FREERDP_API void mf_press_mouse_button(void* context, int button, int x, int y, BOOL down);
|
||||
FREERDP_API void mf_scale_mouse_event(void* context, UINT16 flags, UINT16 x, UINT16 y);
|
||||
FREERDP_API void mf_scale_mouse_event_ex(void* context, UINT16 flags, UINT16 x, UINT16 y);
|
||||
|
||||
/**
|
||||
* Client Interface
|
||||
|
@ -143,7 +143,7 @@ static void mf_scale_mouse_coordinates(mfContext *mfc, UINT16 *px, UINT16 *py)
|
||||
*py = y;
|
||||
}
|
||||
|
||||
void mf_scale_mouse_event(void *context, rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
|
||||
void mf_scale_mouse_event(void *context, UINT16 flags, UINT16 x, UINT16 y)
|
||||
{
|
||||
mfContext *mfc = (mfContext *)context;
|
||||
MRDPView *view = (MRDPView *)mfc->view;
|
||||
@ -152,10 +152,10 @@ void mf_scale_mouse_event(void *context, rdpInput *input, UINT16 flags, UINT16 x
|
||||
|
||||
if ((flags & (PTR_FLAGS_WHEEL | PTR_FLAGS_HWHEEL)) == 0)
|
||||
mf_scale_mouse_coordinates(mfc, &x, &y);
|
||||
freerdp_input_send_mouse_event(input, flags, x, y);
|
||||
freerdp_client_send_button_event(&mfc->common, FALSE, flags, x, y);
|
||||
}
|
||||
|
||||
void mf_scale_mouse_event_ex(void *context, rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
|
||||
void mf_scale_mouse_event_ex(void *context, UINT16 flags, UINT16 x, UINT16 y)
|
||||
{
|
||||
mfContext *mfc = (mfContext *)context;
|
||||
MRDPView *view = (MRDPView *)mfc->view;
|
||||
@ -163,10 +163,10 @@ void mf_scale_mouse_event_ex(void *context, rdpInput *input, UINT16 flags, UINT1
|
||||
y = [view frame].size.height - y;
|
||||
|
||||
mf_scale_mouse_coordinates(mfc, &x, &y);
|
||||
freerdp_input_send_extended_mouse_event(input, flags, x, y);
|
||||
freerdp_client_send_extended_button_event(&mfc->common, FALSE, flags, x, y);
|
||||
}
|
||||
|
||||
void mf_press_mouse_button(void *context, rdpInput *input, int button, int x, int y, BOOL down)
|
||||
void mf_press_mouse_button(void *context, int button, int x, int y, BOOL down)
|
||||
{
|
||||
UINT16 flags = 0;
|
||||
UINT16 xflags = 0;
|
||||
@ -180,23 +180,23 @@ void mf_press_mouse_button(void *context, rdpInput *input, int button, int x, in
|
||||
switch (button)
|
||||
{
|
||||
case 0:
|
||||
mf_scale_mouse_event(context, input, flags | PTR_FLAGS_BUTTON1, x, y);
|
||||
mf_scale_mouse_event(context, flags | PTR_FLAGS_BUTTON1, x, y);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
mf_scale_mouse_event(context, input, flags | PTR_FLAGS_BUTTON2, x, y);
|
||||
mf_scale_mouse_event(context, flags | PTR_FLAGS_BUTTON2, x, y);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
mf_scale_mouse_event(context, input, flags | PTR_FLAGS_BUTTON3, x, y);
|
||||
mf_scale_mouse_event(context, flags | PTR_FLAGS_BUTTON3, x, y);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
mf_scale_mouse_event_ex(context, input, xflags | PTR_XFLAGS_BUTTON1, x, y);
|
||||
mf_scale_mouse_event_ex(context, xflags | PTR_XFLAGS_BUTTON1, x, y);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
mf_scale_mouse_event_ex(context, input, xflags | PTR_XFLAGS_BUTTON2, x, y);
|
||||
mf_scale_mouse_event_ex(context, xflags | PTR_XFLAGS_BUTTON2, x, y);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -59,6 +59,7 @@ static BOOL scale_signed_coordinates(rdpContext* context, int32_t* x, int32_t* y
|
||||
BOOL wlf_handle_pointer_enter(freerdp* instance, const UwacPointerEnterLeaveEvent* ev)
|
||||
{
|
||||
uint32_t x, y;
|
||||
rdpClientContext* cctx;
|
||||
|
||||
if (!instance || !ev || !instance->input)
|
||||
return FALSE;
|
||||
@ -71,16 +72,21 @@ BOOL wlf_handle_pointer_enter(freerdp* instance, const UwacPointerEnterLeaveEven
|
||||
|
||||
WINPR_ASSERT(x <= UINT16_MAX);
|
||||
WINPR_ASSERT(y <= UINT16_MAX);
|
||||
return freerdp_input_send_mouse_event(instance->input, PTR_FLAGS_MOVE, (UINT16)x, (UINT16)y);
|
||||
cctx = (rdpClientContext*)instance->context;
|
||||
return freerdp_client_send_button_event(cctx, FALSE, PTR_FLAGS_MOVE, x, y);
|
||||
}
|
||||
|
||||
BOOL wlf_handle_pointer_motion(freerdp* instance, const UwacPointerMotionEvent* ev)
|
||||
{
|
||||
uint32_t x, y;
|
||||
rdpClientContext* cctx;
|
||||
|
||||
if (!instance || !ev || !instance->input)
|
||||
if (!instance || !ev)
|
||||
return FALSE;
|
||||
|
||||
cctx = (rdpClientContext*)instance->context;
|
||||
WINPR_ASSERT(cctx);
|
||||
|
||||
x = ev->x;
|
||||
y = ev->y;
|
||||
|
||||
@ -89,27 +95,28 @@ BOOL wlf_handle_pointer_motion(freerdp* instance, const UwacPointerMotionEvent*
|
||||
|
||||
WINPR_ASSERT(x <= UINT16_MAX);
|
||||
WINPR_ASSERT(y <= UINT16_MAX);
|
||||
return freerdp_input_send_mouse_event(instance->input, PTR_FLAGS_MOVE, (UINT16)x, (UINT16)y);
|
||||
return freerdp_client_send_button_event(cctx, FALSE, PTR_FLAGS_MOVE, x, y);
|
||||
}
|
||||
|
||||
BOOL wlf_handle_pointer_buttons(freerdp* instance, const UwacPointerButtonEvent* ev)
|
||||
{
|
||||
rdpInput* input;
|
||||
rdpClientContext* cctx;
|
||||
UINT16 flags = 0;
|
||||
UINT16 xflags = 0;
|
||||
uint32_t x, y;
|
||||
|
||||
if (!instance || !ev || !instance->input)
|
||||
if (!instance || !ev)
|
||||
return FALSE;
|
||||
|
||||
cctx = (rdpClientContext*)instance->context;
|
||||
WINPR_ASSERT(cctx);
|
||||
|
||||
x = ev->x;
|
||||
y = ev->y;
|
||||
|
||||
if (!wlf_scale_coordinates(instance->context, &x, &y, TRUE))
|
||||
return FALSE;
|
||||
|
||||
input = instance->input;
|
||||
|
||||
if (ev->state == WL_POINTER_BUTTON_STATE_PRESSED)
|
||||
{
|
||||
flags |= PTR_FLAGS_DOWN;
|
||||
@ -146,10 +153,10 @@ BOOL wlf_handle_pointer_buttons(freerdp* instance, const UwacPointerButtonEvent*
|
||||
WINPR_ASSERT(y <= UINT16_MAX);
|
||||
|
||||
if ((flags & ~PTR_FLAGS_DOWN) != 0)
|
||||
return freerdp_input_send_mouse_event(input, flags, (UINT16)x, (UINT16)y);
|
||||
return freerdp_client_send_button_event(cctx, FALSE, flags, x, y);
|
||||
|
||||
if ((xflags & ~PTR_XFLAGS_DOWN) != 0)
|
||||
return freerdp_input_send_extended_mouse_event(input, xflags, (UINT16)x, (UINT16)y);
|
||||
return freerdp_client_send_extended_button_event(cctx, FALSE, xflags, x, y);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -177,21 +184,19 @@ BOOL wlf_handle_pointer_axis_discrete(freerdp* instance, const UwacPointerAxisEv
|
||||
static BOOL wlf_handle_wheel(freerdp* instance, uint32_t x, uint32_t y, uint32_t axis,
|
||||
int32_t value)
|
||||
{
|
||||
rdpInput* input;
|
||||
rdpClientContext* cctx;
|
||||
UINT16 flags = 0;
|
||||
int32_t direction;
|
||||
uint32_t avalue = (uint32_t)abs(value);
|
||||
|
||||
WINPR_ASSERT(instance);
|
||||
|
||||
input = instance->input;
|
||||
WINPR_ASSERT(input);
|
||||
cctx = (rdpClientContext*)instance->context;
|
||||
WINPR_ASSERT(cctx);
|
||||
|
||||
if (!wlf_scale_coordinates(instance->context, &x, &y, TRUE))
|
||||
return FALSE;
|
||||
|
||||
input = instance->input;
|
||||
|
||||
direction = value;
|
||||
switch (axis)
|
||||
{
|
||||
@ -224,7 +229,7 @@ static BOOL wlf_handle_wheel(freerdp* instance, uint32_t x, uint32_t y, uint32_t
|
||||
/* Convert negative values to 9bit twos complement */
|
||||
if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
|
||||
cflags = (flags & 0xFF00) | (0x100 - cval);
|
||||
if (!freerdp_input_send_mouse_event(input, cflags, (UINT16)x, (UINT16)y))
|
||||
if (!freerdp_client_send_wheel_event(cctx, cflags))
|
||||
return FALSE;
|
||||
|
||||
avalue -= cval;
|
||||
@ -358,10 +363,14 @@ BOOL wlf_keyboard_modifiers(freerdp* instance, const UwacKeyboardModifiersEvent*
|
||||
{
|
||||
rdpInput* input;
|
||||
UINT16 syncFlags;
|
||||
wlfContext* wlf;
|
||||
|
||||
if (!instance || !ev || !instance->input)
|
||||
return FALSE;
|
||||
|
||||
wlf = (wlfContext*)instance->context;
|
||||
WINPR_ASSERT(wlf);
|
||||
|
||||
input = instance->input;
|
||||
syncFlags = 0;
|
||||
|
||||
@ -370,13 +379,13 @@ BOOL wlf_keyboard_modifiers(freerdp* instance, const UwacKeyboardModifiersEvent*
|
||||
if (ev->modifiers & UWAC_MOD_NUM_MASK)
|
||||
syncFlags |= KBD_SYNC_NUM_LOCK;
|
||||
|
||||
if (!((wlfContext*)instance->context)->focusing)
|
||||
if (!wlf->focusing)
|
||||
return TRUE;
|
||||
|
||||
((wlfContext*)instance->context)->focusing = FALSE;
|
||||
|
||||
return freerdp_input_send_focus_in_event(input, syncFlags) &&
|
||||
freerdp_input_send_mouse_event(input, PTR_FLAGS_MOVE, 0, 0);
|
||||
freerdp_client_send_button_event(&wlf->common, FALSE, PTR_FLAGS_MOVE, 0, 0);
|
||||
}
|
||||
|
||||
BOOL wlf_handle_touch_up(freerdp* instance, const UwacTouchUp* ev)
|
||||
@ -422,7 +431,7 @@ BOOL wlf_handle_touch_up(freerdp* instance, const UwacTouchUp* ev)
|
||||
|
||||
WINPR_ASSERT(x <= UINT16_MAX);
|
||||
WINPR_ASSERT(y <= UINT16_MAX);
|
||||
return freerdp_input_send_mouse_event(instance->input, flags, (UINT16)x, (UINT16)y);
|
||||
return freerdp_client_send_button_event(&wlf->common, FALSE, flags, x, y);
|
||||
}
|
||||
|
||||
if (!rdpei)
|
||||
@ -483,7 +492,7 @@ BOOL wlf_handle_touch_down(freerdp* instance, const UwacTouchDown* ev)
|
||||
|
||||
WINPR_ASSERT(x <= UINT16_MAX);
|
||||
WINPR_ASSERT(y <= UINT16_MAX);
|
||||
return freerdp_input_send_mouse_event(instance->input, flags, (UINT16)x, (UINT16)y);
|
||||
return freerdp_client_send_button_event(&wlf->common, FALSE, flags, x, y);
|
||||
}
|
||||
|
||||
WINPR_ASSERT(rdpei);
|
||||
@ -541,7 +550,7 @@ BOOL wlf_handle_touch_motion(freerdp* instance, const UwacTouchMotion* ev)
|
||||
|
||||
WINPR_ASSERT(x <= UINT16_MAX);
|
||||
WINPR_ASSERT(y <= UINT16_MAX);
|
||||
return freerdp_input_send_mouse_event(instance->input, flags, (UINT16)x, (UINT16)y);
|
||||
return freerdp_client_send_button_event(&wlf->common, FALSE, flags, x, y);
|
||||
}
|
||||
|
||||
if (!rdpei)
|
||||
|
@ -45,10 +45,10 @@ static HWND g_focus_hWnd;
|
||||
|
||||
static BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, HDC hdcSrc, int x1,
|
||||
int y1, DWORD rop);
|
||||
static BOOL wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
||||
static BOOL wf_scale_mouse_event(wfContext* wfc, UINT16 flags, UINT16 x, UINT16 y);
|
||||
#if (_WIN32_WINNT >= 0x0500)
|
||||
static BOOL wf_scale_mouse_event_ex(wfContext* wfc, rdpInput* input, UINT16 flags,
|
||||
UINT16 buttonMask, UINT16 x, UINT16 y);
|
||||
static BOOL wf_scale_mouse_event_ex(wfContext* wfc, UINT16 flags, UINT16 buttonMask, UINT16 x,
|
||||
UINT16 y);
|
||||
#endif
|
||||
|
||||
static BOOL g_flipping_in;
|
||||
@ -221,7 +221,7 @@ static BOOL wf_event_process_WM_MOUSEWHEEL(wfContext* wfc, HWND hWnd, UINT Msg,
|
||||
}
|
||||
|
||||
flags |= delta;
|
||||
return wf_scale_mouse_event(wfc, input, flags, x, y);
|
||||
return wf_scale_mouse_event(wfc, flags, x, y);
|
||||
}
|
||||
|
||||
static void wf_sizing(wfContext* wfc, WPARAM wParam, LPARAM lParam)
|
||||
@ -432,50 +432,50 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
|
||||
#if (_WIN32_WINNT >= 0x0500)
|
||||
|
||||
case WM_XBUTTONDOWN:
|
||||
wf_scale_mouse_event_ex(wfc, input, PTR_XFLAGS_DOWN, GET_XBUTTON_WPARAM(wParam),
|
||||
wf_scale_mouse_event_ex(wfc, PTR_XFLAGS_DOWN, GET_XBUTTON_WPARAM(wParam),
|
||||
X_POS(lParam) - wfc->offset_x,
|
||||
Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
|
||||
case WM_XBUTTONUP:
|
||||
wf_scale_mouse_event_ex(wfc, input, 0, GET_XBUTTON_WPARAM(wParam),
|
||||
wf_scale_mouse_event_ex(wfc, 0, GET_XBUTTON_WPARAM(wParam),
|
||||
X_POS(lParam) - wfc->offset_x,
|
||||
Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case WM_MBUTTONDOWN:
|
||||
wf_scale_mouse_event(wfc, input, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON3,
|
||||
wf_scale_mouse_event(wfc, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON3,
|
||||
X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
|
||||
case WM_MBUTTONUP:
|
||||
wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON3, X_POS(lParam) - wfc->offset_x,
|
||||
wf_scale_mouse_event(wfc, PTR_FLAGS_BUTTON3, X_POS(lParam) - wfc->offset_x,
|
||||
Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
wf_scale_mouse_event(wfc, input, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1,
|
||||
wf_scale_mouse_event(wfc, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1,
|
||||
X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON1, X_POS(lParam) - wfc->offset_x,
|
||||
wf_scale_mouse_event(wfc, PTR_FLAGS_BUTTON1, X_POS(lParam) - wfc->offset_x,
|
||||
Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
|
||||
case WM_RBUTTONDOWN:
|
||||
wf_scale_mouse_event(wfc, input, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON2,
|
||||
wf_scale_mouse_event(wfc, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON2,
|
||||
X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
|
||||
case WM_RBUTTONUP:
|
||||
wf_scale_mouse_event(wfc, input, PTR_FLAGS_BUTTON2, X_POS(lParam) - wfc->offset_x,
|
||||
wf_scale_mouse_event(wfc, PTR_FLAGS_BUTTON2, X_POS(lParam) - wfc->offset_x,
|
||||
Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
wf_scale_mouse_event(wfc, input, PTR_FLAGS_MOVE, X_POS(lParam) - wfc->offset_x,
|
||||
wf_scale_mouse_event(wfc, PTR_FLAGS_MOVE, X_POS(lParam) - wfc->offset_x,
|
||||
Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
|
||||
@ -808,14 +808,16 @@ static BOOL wf_scale_mouse_pos(wfContext* wfc, UINT16* x, UINT16* y)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
|
||||
static BOOL wf_scale_mouse_event(wfContext* wfc, UINT16 flags, UINT16 x, UINT16 y)
|
||||
{
|
||||
MouseEventEventArgs eventArgs;
|
||||
|
||||
WINPR_ASSERT(wfc);
|
||||
|
||||
if (!wf_scale_mouse_pos(wfc, &x, &y))
|
||||
return FALSE;
|
||||
|
||||
if (freerdp_input_send_mouse_event(input, flags, x, y))
|
||||
if (freerdp_client_send_button_event(&wfc->common, FALSE, flags, x, y))
|
||||
return FALSE;
|
||||
|
||||
eventArgs.flags = flags;
|
||||
@ -826,11 +828,13 @@ static BOOL wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags,
|
||||
}
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0500)
|
||||
static BOOL wf_scale_mouse_event_ex(wfContext* wfc, rdpInput* input, UINT16 flags,
|
||||
UINT16 buttonMask, UINT16 x, UINT16 y)
|
||||
static BOOL wf_scale_mouse_event_ex(wfContext* wfc, UINT16 flags, UINT16 buttonMask, UINT16 x,
|
||||
UINT16 y)
|
||||
{
|
||||
MouseEventExEventArgs eventArgs;
|
||||
|
||||
WINPR_ASSERT(wfc);
|
||||
|
||||
if (buttonMask & XBUTTON1)
|
||||
flags |= PTR_XFLAGS_BUTTON1;
|
||||
|
||||
@ -840,7 +844,7 @@ static BOOL wf_scale_mouse_event_ex(wfContext* wfc, rdpInput* input, UINT16 flag
|
||||
if (!wf_scale_mouse_pos(wfc, &x, &y))
|
||||
return FALSE;
|
||||
|
||||
if (freerdp_input_send_extended_mouse_event(input, flags, x, y))
|
||||
if (freerdp_client_send_extended_button_event(&wfc->common, FALSE, flags, x, y))
|
||||
return FALSE;
|
||||
|
||||
eventArgs.flags = flags;
|
||||
|
@ -417,7 +417,7 @@ BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, int state, Window win
|
||||
}
|
||||
|
||||
xf_event_adjust_coordinates(xfc, &x, &y);
|
||||
freerdp_input_send_mouse_event(input, PTR_FLAGS_MOVE, x, y);
|
||||
freerdp_client_send_button_event(&xfc->common, FALSE, PTR_FLAGS_MOVE, x, y);
|
||||
|
||||
if (xfc->fullscreen && !app)
|
||||
{
|
||||
@ -442,7 +442,6 @@ BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button, Window win
|
||||
BOOL down)
|
||||
{
|
||||
UINT16 flags = 0;
|
||||
rdpInput* input;
|
||||
Window childWindow;
|
||||
size_t i;
|
||||
|
||||
@ -459,14 +458,12 @@ BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button, Window win
|
||||
}
|
||||
}
|
||||
|
||||
input = xfc->common.context.input;
|
||||
|
||||
if (flags != 0)
|
||||
{
|
||||
if (flags & (PTR_FLAGS_WHEEL | PTR_FLAGS_HWHEEL))
|
||||
{
|
||||
if (down)
|
||||
freerdp_input_send_mouse_event(input, flags, 0, 0);
|
||||
freerdp_client_send_wheel_event(&xfc->common, flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -499,9 +496,9 @@ BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button, Window win
|
||||
xf_event_adjust_coordinates(xfc, &x, &y);
|
||||
|
||||
if (extended)
|
||||
freerdp_input_send_extended_mouse_event(input, flags, x, y);
|
||||
freerdp_client_send_extended_button_event(&xfc->common, FALSE, flags, x, y);
|
||||
else
|
||||
freerdp_input_send_mouse_event(input, flags, x, y);
|
||||
freerdp_client_send_button_event(&xfc->common, FALSE, flags, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ void xf_keyboard_focus_in(xfContext* xfc)
|
||||
if (x >= 0 && x < xfc->window->width && y >= 0 && y < xfc->window->height)
|
||||
{
|
||||
xf_event_adjust_coordinates(xfc, &x, &y);
|
||||
freerdp_input_send_mouse_event(input, PTR_FLAGS_MOVE, x, y);
|
||||
freerdp_client_send_button_event(&xfc->common, FALSE, PTR_FLAGS_MOVE, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ void xf_rail_end_local_move(xfContext* xfc, xfAppWindow* appWindow)
|
||||
if ((appWindow->local_move.direction != _NET_WM_MOVERESIZE_MOVE_KEYBOARD) &&
|
||||
(appWindow->local_move.direction != _NET_WM_MOVERESIZE_SIZE_KEYBOARD))
|
||||
{
|
||||
freerdp_input_send_mouse_event(input, PTR_FLAGS_BUTTON1, x, y);
|
||||
freerdp_client_send_button_event(&xfc->common, FALSE, PTR_FLAGS_BUTTON1, x, y);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user