From e0acb7a464bc6290c14ee6ab38ed13f6156eef5b Mon Sep 17 00:00:00 2001 From: Shannon Madsen Date: Thu, 3 Oct 2013 20:38:04 -0700 Subject: [PATCH] Fix extended mouse event to register the click for forward/back buttons --- server/X11/xf_input.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/X11/xf_input.c b/server/X11/xf_input.c index 14d55fca7..c47e996da 100644 --- a/server/X11/xf_input.c +++ b/server/X11/xf_input.c @@ -123,10 +123,24 @@ void xf_input_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT { #ifdef WITH_XTEST xfPeerContext* xfp = (xfPeerContext*) input->context; + int button = 0; + BOOL down = FALSE; xfInfo* xfi = xfp->info; XTestGrabControl(xfi->display, True); XTestFakeMotionEvent(xfi->display, 0, x, y, CurrentTime); + + if (flags & PTR_XFLAGS_BUTTON1) + button = 8; + else if (flags & PTR_XFLAGS_BUTTON2) + button = 9; + + if (flags & PTR_XFLAGS_DOWN) + down = TRUE; + + if (button != 0) + XTestFakeButtonEvent(xfi->display, button, down, 0); + XTestGrabControl(xfi->display, False); #endif }