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); 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