mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Merge pull request #2354 from bmiklautz/ts_pointer_pdu
Handle Server Pointer Update PDU client side
This commit is contained in:
@@ -319,6 +319,21 @@ void xf_Pointer_SetDefault(rdpContext* context)
|
||||
#endif
|
||||
}
|
||||
|
||||
void xf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y)
|
||||
{
|
||||
xfContext* xfc = (xfContext*) context;
|
||||
|
||||
if (!xfc->focused)
|
||||
return;
|
||||
|
||||
xf_lock_x11(xfc, FALSE);
|
||||
|
||||
if (xfc->window)
|
||||
XWarpPointer(xfc->display, None, xfc->window->handle, 0, 0, 0, 0, x, y);
|
||||
|
||||
xf_unlock_x11(xfc, FALSE);
|
||||
}
|
||||
|
||||
/* Glyph Class */
|
||||
|
||||
void xf_Glyph_New(rdpContext* context, rdpGlyph* glyph)
|
||||
@@ -454,6 +469,7 @@ void xf_register_graphics(rdpGraphics* graphics)
|
||||
pointer->Set = xf_Pointer_Set;
|
||||
pointer->SetNull = xf_Pointer_SetNull;
|
||||
pointer->SetDefault = xf_Pointer_SetDefault;
|
||||
pointer->SetPosition = xf_Pointer_SetPosition;
|
||||
|
||||
graphics_register_pointer(graphics, pointer);
|
||||
free(pointer);
|
||||
|
||||
@@ -88,6 +88,7 @@ typedef void (*pPointer_Free)(rdpContext* context, rdpPointer* pointer);
|
||||
typedef void (*pPointer_Set)(rdpContext* context, rdpPointer* pointer);
|
||||
typedef void (*pPointer_SetNull)(rdpContext* context);
|
||||
typedef void (*pPointer_SetDefault)(rdpContext* context);
|
||||
typedef void (*pPointer_SetPosition)(rdpContext* context, UINT32 x, UINT32 y);
|
||||
|
||||
struct rdp_pointer
|
||||
{
|
||||
@@ -97,7 +98,8 @@ struct rdp_pointer
|
||||
pPointer_Set Set; /* 3 */
|
||||
pPointer_SetNull SetNull; /* 4*/
|
||||
pPointer_SetDefault SetDefault; /* 5 */
|
||||
UINT32 paddingA[16 - 6]; /* 6 */
|
||||
pPointer_SetPosition SetPosition; /* 6 */
|
||||
UINT32 paddingA[16 - 7]; /* 7 */
|
||||
|
||||
UINT32 xPos; /* 16 */
|
||||
UINT32 yPos; /* 17 */
|
||||
@@ -117,6 +119,7 @@ FREERDP_API void Pointer_Free(rdpContext* context, rdpPointer* pointer);
|
||||
FREERDP_API void Pointer_Set(rdpContext* context, rdpPointer* pointer);
|
||||
FREERDP_API void Pointer_SetNull(rdpContext* context);
|
||||
FREERDP_API void Pointer_SetDefault(rdpContext* context);
|
||||
FREERDP_API void Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y);
|
||||
|
||||
/* Glyph Class */
|
||||
|
||||
|
||||
2
libfreerdp/cache/pointer.c
vendored
2
libfreerdp/cache/pointer.c
vendored
@@ -35,7 +35,7 @@
|
||||
|
||||
void update_pointer_position(rdpContext* context, POINTER_POSITION_UPDATE* pointer_position)
|
||||
{
|
||||
|
||||
Pointer_SetPosition(context, pointer_position->xPos, pointer_position->yPos);
|
||||
}
|
||||
|
||||
void update_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system)
|
||||
|
||||
@@ -148,6 +148,11 @@ void Pointer_SetDefault(rdpContext* context)
|
||||
context->graphics->Pointer_Prototype->SetDefault(context);
|
||||
}
|
||||
|
||||
void Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y)
|
||||
{
|
||||
IFCALL(context->graphics->Pointer_Prototype->SetPosition, context, x, y);
|
||||
}
|
||||
|
||||
void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer)
|
||||
{
|
||||
CopyMemory(graphics->Pointer_Prototype, pointer, sizeof(rdpPointer));
|
||||
|
||||
Reference in New Issue
Block a user