mirror of https://github.com/FreeRDP/FreeRDP
Fix issue 202. No cursor icons for RemoteApp
Pointer updates are part of the base RDP protocol MS-RDPBCGR specification and do not include window information like those from the RAIL specification MS-RDPERP do. To make pointer updates work, we need to keep track of which window has focus and then apply pointer updates to that window. This appears to be easy to do, just watch for X11 EnterNotify events and update the window field of the main RDP structure. I had some concerns that a window might receive an old pointer update for some other window due to network latencies, however, the RDP server seems to always send down new pointer updates whenver a window takes focus.
This commit is contained in:
parent
dfe9f5dcf0
commit
96accb0327
|
@ -411,6 +411,17 @@ boolean xf_event_EnterNotify(xfInfo* xfi, XEvent* event, boolean app)
|
|||
|
||||
if (xfi->focused)
|
||||
XGrabKeyboard(xfi->display, xfi->window->handle, True, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
} else {
|
||||
// Keep track of which window has focus so that we can apply pointer updates
|
||||
xfWindow* xfw;
|
||||
rdpWindow* window;
|
||||
rdpRail* rail = ((rdpContext*) xfi->context)->rail;
|
||||
window = window_list_get_by_extra_id(rail->list, (void*) event->xexpose.window);
|
||||
if (window != NULL)
|
||||
{
|
||||
xfw = (xfWindow*) window->extra;
|
||||
xfi->window = xfw;
|
||||
}
|
||||
}
|
||||
|
||||
return True;
|
||||
|
|
|
@ -191,10 +191,12 @@ void xf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
|||
{
|
||||
xfInfo* xfi = ((xfContext*) context)->xfi;
|
||||
|
||||
if (xfi->remote_app != True)
|
||||
// In remote app mode, window can be null if none has had focus
|
||||
if (xfi->window != NULL)
|
||||
{
|
||||
XDefineCursor(xfi->display, xfi->window->handle, ((xfPointer*) pointer)->cursor);
|
||||
}
|
||||
}
|
||||
|
||||
/* Glyph Class */
|
||||
|
||||
void xf_Glyph_New(rdpContext* context, rdpGlyph* glyph)
|
||||
|
|
|
@ -364,7 +364,7 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width,
|
|||
input_mask =
|
||||
KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
|
||||
VisibilityChangeMask | FocusChangeMask | StructureNotifyMask |
|
||||
PointerMotionMask | ExposureMask;
|
||||
PointerMotionMask | ExposureMask | EnterWindowMask;
|
||||
|
||||
XSelectInput(xfi->display, window->handle, input_mask);
|
||||
XMapWindow(xfi->display, window->handle);
|
||||
|
|
Loading…
Reference in New Issue