diff options
author | Joshua Hudson <joshudson@gmail.com> | 2017-10-25 19:22:35 -0700 |
---|---|---|
committer | Henrik Andersson <hean01@cendio.com> | 2017-11-01 06:47:31 +0100 |
commit | e7cda3dbf8074c78ff9ad852a59811b10a78dcb8 (patch) | |
tree | 170a8acc396e82fe53a5ffed828c84a3dc4ad1e3 | |
parent | 5aa5a9dbfc362d1cd3e773915bcf48ac60fc2ec9 (diff) | |
download | rdesktop-e7cda3dbf8074c78ff9ad852a59811b10a78dcb8.zip |
add -M for local mouse cursor
-rw-r--r-- | doc/rdesktop.1 | 5 | ||||
-rw-r--r-- | rdesktop.c | 13 | ||||
-rw-r--r-- | rdp.c | 2 | ||||
-rw-r--r-- | xwin.c | 2 |
4 files changed, 21 insertions, 1 deletions
diff --git a/doc/rdesktop.1 b/doc/rdesktop.1 index 3708105..64abf11 100644 --- a/doc/rdesktop.1 +++ b/doc/rdesktop.1 @@ -128,6 +128,11 @@ but everything after this is unencrypted (including interactive logins). Do not send mouse motion events. This saves bandwidth, although some Windows applications may rely on receiving mouse motion. .TP +.BR "-M" +Use local X cursor inherited from window manager instead of server cursor. This +is mostly useful with -m, but is also useful if the server is sending bogus +mouse cursors. +.TP .BR "-C" Use private colourmap. This will improve colour accuracy on an 8-bit display, but rdesktop will appear in false colour when not focused. @@ -96,6 +96,7 @@ RD_BOOL g_desktop_save = True; /* desktop save order */ RD_BOOL g_polygon_ellipse_orders = True; /* polygon / ellipse orders */ RD_BOOL g_fullscreen = False; RD_BOOL g_grab_keyboard = True; +RD_BOOL g_local_cursor = False; RD_BOOL g_hide_decorations = False; RDP_VERSION g_rdp_version = RDP_V5; /* Default to version 5 */ RD_BOOL g_rdpclip = True; @@ -182,6 +183,7 @@ usage(char *program) fprintf(stderr, " -e: disable encryption (French TS)\n"); fprintf(stderr, " -E: disable encryption from client to server\n"); fprintf(stderr, " -m: do not send motion events\n"); + fprintf(stderr, " -M: use local mouse cursor\n"); fprintf(stderr, " -C: use private colour map\n"); fprintf(stderr, " -D: hide window manager decorations\n"); fprintf(stderr, " -K: keep window manager key bindings\n"); @@ -638,7 +640,7 @@ main(int argc, char *argv[]) g_num_devices = 0; while ((c = getopt(argc, argv, - "A:u:L:d:s:c:p:n:k:g:o:fbBeEitmzCDKS:T:NX:a:x:Pr:045vh?")) != -1) + "A:u:L:d:s:c:p:n:k:g:o:fbBeEitmMzCDKS:T:NX:a:x:Pr:045vh?")) != -1) { switch (c) { @@ -787,6 +789,9 @@ main(int argc, char *argv[]) case 'm': g_sendmotion = False; break; + case 'M': + g_local_cursor = True; + break; case 'C': g_owncolmap = True; @@ -1040,6 +1045,12 @@ main(int argc, char *argv[]) usage(argv[0]); return EX_USAGE; } + if (g_local_cursor) + { + /* there is no point wasting bandwidth on cursor shadows + * that we're just going to throw out anyway */ + g_rdp5_performanceflags |= PERF_DISABLE_CURSOR_SHADOW; + } STRNCPY(server, argv[optind], sizeof(server)); parse_server_and_port(server); @@ -1171,6 +1171,7 @@ process_demand_active(STREAM s) static void process_colour_pointer_common(STREAM s, int bpp) { + extern RD_BOOL g_local_cursor; uint16 width, height, cache_idx, masklen, datalen; uint16 x, y; uint8 *mask; @@ -1194,6 +1195,7 @@ process_colour_pointer_common(STREAM s, int bpp) /* keep hotspot within cursor bounding box */ x = MIN(x, width - 1); y = MIN(y, height - 1); + if (g_local_cursor) return ; /* don't bother creating a cursor we won't use */ cursor = ui_create_cursor(x, y, width, height, mask, data, bpp); ui_set_cursor(cursor); cache_put_cursor(cache_idx, cursor); @@ -3088,6 +3088,8 @@ ui_create_cursor(unsigned int xhot, unsigned int yhot, uint32 width, void ui_set_cursor(RD_HCURSOR cursor) { + extern RD_BOOL g_local_cursor; + if (g_local_cursor) return ; logger(GUI, Debug, "ui_set_cursor(): g_current_cursor = %p, new = %p", g_current_cursor, cursor); |