From dfe9f5dcf0743ef039adb89be409b2c510e33ad3 Mon Sep 17 00:00:00 2001 From: David Sundstrom Date: Fri, 11 Nov 2011 01:53:46 -0600 Subject: [PATCH 1/2] add options for DEBUG_X11_LOCAL_MOVESIZE that were present in code --- cmake/ConfigOptions.cmake | 1 + config.h.in | 1 + 2 files changed, 2 insertions(+) diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index fb5daa97b..5c80ea24a 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -10,6 +10,7 @@ option(WITH_DEBUG_LICENSE "Print license debug messages." OFF) option(WITH_DEBUG_GDI "Print graphics debug messages." OFF) option(WITH_DEBUG_RFX "Print RemoteFX debug messages." OFF) option(WITH_DEBUG_X11 "Print X11 Client debug messages" OFF) +option(WITH_DEBUG_X11_LOCAL_MOVESIZE "Print X11 Client local movesize debug messages" OFF) option(WITH_DEBUG_RAIL "Print RemoteApp debug messages" OFF) option(WITH_DEBUG_XV "Print XVideo debug messages" OFF) option(WITH_DEBUG_SCARD "Print smartcard debug messages" OFF) diff --git a/config.h.in b/config.h.in index 741011990..aeec31974 100644 --- a/config.h.in +++ b/config.h.in @@ -33,6 +33,7 @@ #cmakedefine WITH_SSE2 #cmakedefine WITH_SSE2_TARGET #cmakedefine WITH_DEBUG_X11 +#cmakedefine WITH_DEBUG_X11_LOCAL_MOVESIZE #cmakedefine WITH_DEBUG_RAIL #cmakedefine WITH_DEBUG_XV #cmakedefine WITH_DEBUG_SCARD From 96accb0327c6cf70e344aff8bc8b45eb7623db0b Mon Sep 17 00:00:00 2001 From: David Sundstrom Date: Mon, 14 Nov 2011 16:36:25 -0600 Subject: [PATCH 2/2] 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. --- client/X11/xf_event.c | 11 +++++++++++ client/X11/xf_graphics.c | 6 ++++-- client/X11/xf_window.c | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/client/X11/xf_event.c b/client/X11/xf_event.c index 9effe06f1..4fc73398a 100644 --- a/client/X11/xf_event.c +++ b/client/X11/xf_event.c @@ -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; diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c index 265ef4733..681ce3f66 100644 --- a/client/X11/xf_graphics.c +++ b/client/X11/xf_graphics.c @@ -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) diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index 77c202459..378b67472 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -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);