diff options
author | Otavio Salvador <otavio@debian.org> | 2011-06-17 23:27:51 +0400 |
---|---|---|
committer | Otavio Salvador <otavio@debian.org> | 2011-06-17 23:27:51 +0400 |
commit | 550c2ab736d7905ccaf1624437c210210bec9365 (patch) | |
tree | 0a365ff38eb17dd827be3dcf17ad4d4d5f8f036b | |
parent | d1eef40acc994d85cb78c0a98914edc097c9b44d (diff) | |
parent | 586b55957cb6f4b9a3fec9ba3e5201105cb49042 (diff) |
Merge pull request #45 from OSSystems/master
Do not send mouse motion events option (-m)
-rw-r--r-- | X11/xf_event.c | 3 | ||||
-rw-r--r-- | X11/xfreerdp.c | 6 | ||||
-rw-r--r-- | docs/xfreerdp.1 | 3 | ||||
-rw-r--r-- | include/freerdp/rdpset.h | 1 | ||||
-rw-r--r-- | libfreerdp-core/rdp.c | 12 |
5 files changed, 21 insertions, 4 deletions
diff --git a/X11/xf_event.c b/X11/xf_event.c index 5991184..e81fc41 100644 --- a/X11/xf_event.c +++ b/X11/xf_event.c @@ -62,6 +62,9 @@ xf_handle_event_MotionNotify(xfInfo * xfi, XEvent * xevent) { if (xevent->xmotion.window == xfi->wnd) { + if (!xfi->settings->mouse_motion) + if ((xevent->xmotion.state & (Button1Mask | Button2Mask | Button3Mask)) == 0) + return 0; xfi->inst->rdp_send_input_mouse(xfi->inst, PTRFLAGS_MOVE, xevent->xmotion.x, xevent->xmotion.y); } diff --git a/X11/xfreerdp.c b/X11/xfreerdp.c index 315f5ef..1a11551 100644 --- a/X11/xfreerdp.c +++ b/X11/xfreerdp.c @@ -73,6 +73,7 @@ set_default_params(xfInfo * xfi) settings->desktop_save = 0; settings->performanceflags = PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG | PERF_DISABLE_MENUANIMATIONS; + settings->mouse_motion = 1; settings->off_screen_bitmaps = 1; settings->polygon_ellipse_orders = 1; settings->triblt = 0; @@ -122,6 +123,7 @@ out_args(void) "\t-z: enable bulk compression\n" "\t--gdi: GDI rendering (sw or hw, for software or hardware)\n" "\t-x: performance flags (m, b or l for modem, broadband or lan)\n" + "\t-m: don't send mouse motion events\n" "\t-X: embed into another window with a given XID.\n" #ifndef DISABLE_TLS "\t--no-rdp: disable Standard RDP encryption\n" @@ -391,6 +393,10 @@ process_params(xfInfo * xfi, int argc, char ** argv, int * pindex) settings->performanceflags = PERF_FLAG_NONE; xfi->codec = XF_CODEC_REMOTEFX; } + else if (strcmp("-m", argv[*pindex]) == 0) + { + settings->mouse_motion = 0; + } else if (strcmp("--app", argv[*pindex]) == 0) { *pindex = *pindex + 1; diff --git a/docs/xfreerdp.1 b/docs/xfreerdp.1 index 09f630e..e4768fd 100644 --- a/docs/xfreerdp.1 +++ b/docs/xfreerdp.1 @@ -71,6 +71,9 @@ also enable the desktop wallpaper. Setting experience to m[odem] disables all (including themes). Experience can also be a hexidecimal number containing the flags. .TP +.BR "-m" +Do not send mouse motion events. +.TP .BR "-0" Attach to the admin console of the server. This is the default if no server license is available. diff --git a/include/freerdp/rdpset.h b/include/freerdp/rdpset.h index 52f5540..298f6d7 100644 --- a/include/freerdp/rdpset.h +++ b/include/freerdp/rdpset.h @@ -82,6 +82,7 @@ struct rdp_set int off_screen_bitmaps; int triblt; int new_cursors; + int mouse_motion; int bulk_compression; int rfx_flags; /* 0 no remotefx */ int ui_decode_flags; diff --git a/libfreerdp-core/rdp.c b/libfreerdp-core/rdp.c index dceb631..701fddf 100644 --- a/libfreerdp-core/rdp.c +++ b/libfreerdp-core/rdp.c @@ -997,7 +997,8 @@ process_color_pointer_common(rdpRdp * rdp, STREAM s, int bpp) y = MAX(y, 0); y = MIN(y, height - 1); cursor = ui_create_cursor(rdp->inst, x, y, width, height, mask, data, bpp); - ui_set_cursor(rdp->inst, cursor); + if (rdp->inst->settings->mouse_motion) + ui_set_cursor(rdp->inst, cursor); cache_put_cursor(rdp->cache, cache_idx, cursor); } @@ -1015,7 +1016,8 @@ process_cached_pointer_pdu(rdpRdp * rdp, STREAM s) uint16 cache_idx; in_uint16_le(s, cache_idx); - ui_set_cursor(rdp->inst, cache_get_cursor(rdp->cache, cache_idx)); + if (rdp->inst->settings->mouse_motion) + ui_set_cursor(rdp->inst, cache_get_cursor(rdp->cache, cache_idx)); } /* Process a system pointer PDU */ @@ -1028,11 +1030,13 @@ process_system_pointer_pdu(rdpRdp * rdp, STREAM s) switch (system_pointer_type) { case RDP_SYSPTR_NULL: - ui_set_null_cursor(rdp->inst); + if (rdp->inst->settings->mouse_motion) + ui_set_null_cursor(rdp->inst); break; case RDP_SYSPTR_DEFAULT: - ui_set_default_cursor(rdp->inst); + if (rdp->inst->settings->mouse_motion) + ui_set_default_cursor(rdp->inst); break; default: |