Commit Graph

2472 Commits

Author SHA1 Message Date
David Fort 5ef9232703 Merge pull request #3905 from ilammy/x11-cliprdr/file-clipping
Local-to-remote file clipping for xfreerdp
2017-06-07 21:20:34 +02:00
ilammy ac2b13fdcc client/X11: do not fixup HTML data length
The data provided by local applications can be actually encoded in
UTF-16 (e.g., Firefox does this to HTML). UTF-16 allows embedded null
bytes so we should not use strlen() to fix up the data. The HTML format
synthesizer can handle trailing null bytes just fine and can detect
whether it deals with UTF-8 or UTF-16.
2017-05-31 05:01:30 +03:00
ilammy 34b092058f x11/cliprdr: make callbacks static
Most of the functions is this file are internal-use callbacks so they do
not need to be exported from the compilation unit. Mark functions static
as appropriate.
2017-05-24 23:05:42 +03:00
David Fort 17a4e95a5b Drop some annoying warning
Probably that some unused functions should be removed, but at least it makes
it compile with no warnings.
2017-05-12 13:54:16 +02:00
Armin Novak b1d631f1e5 Added support for Set Keyboard IME Status 2017-05-12 09:43:58 +02:00
David Fort d170c10ee6 Fix H264 in multi monitor case
The H264 context is surface specific, so in multi-monitor (with multiple surfaces)
the decoding was failing. This patch fixes that by introducing a surface specific
h264 context.
2017-05-02 18:39:33 +02:00
ilammy 82f3abac49 client/X11: teach RAIL to use clipboard redirection
XSelection protocol does not define any global clipboard as there is on
Windows. Instead each window has its own property for clipboard content
(like CLIPBOARD or PRIMARY) and there is a global notion of clipboard
ownership.  Only one window can claim ownership of some clipboard type
at the moment.

FreeRDP uses CLIPBOARD for clipboard transfers (it's the one used by
applications when Ctrl+V is pressed). For regular desktop sessions the
session window itself is used for clipboard interactions via
xfc->drawable field. However, for remote app session there is no session
window. We cannot use the current remote app window as it may change or
be destroyed without closing the session. We also cannot use the root
window as it is already used for CF_RAW transfer protocol.

Therefore we create a simple dummy window to put into xfc->drawable for
this exact job: to act as a clipboard vessel on behalf of the entire
remote app session.

xf_create_window() usually creates the window as we immediately start in
RAIL mode when possible. xf_rail_enable_remoteapp_mode() is invoked only
when autologin failed or remote desktop had to show the session window
to the user for some reason.
2017-05-01 02:10:55 +03:00
Shaun Maher b547386498 WS_EX_NOACTIVATE treated as unmanaged\nWindows that carry the WS_EX_NOACTIVATE are treated the same as WS_EX_TOOLWINDOW in that they should not be handled as normal windows by the X window manager. The prevents an issue with MS Outlook 2013 (and probably other applications) where attempting to resize the vertical columns causes some sort of WS_EX_NOACTIVATE window to be created which steals focus and aborts the resizing action. 2017-04-22 18:44:37 +10:00
Norbert Federa 263348ff2b client/x11: fix gfx drawing bug with /multimon
The surface's damage region is not relative to the output but
lives in its own universe starting at origin 0,0.

Also fixed the drawing coordinates used in the XRENDER code path
which is used with /smart-sizing
2017-04-11 12:30:37 +02:00
ilammy b9ab82214a x11/cliprdr: negotiate file streaming support
Now that we've got everything in place to handle files it's time to tell
the server that we can actually do this.

MS-RDPECLIP 3.2.5.1.3 Sending a Client Clipboard Capabilities PDU asks
us politely to not advertise file clipping support if the server did not
do that itself. Thus we need to parse the capabilities sent by the
server and take a note whether it supports file clipping.

There is also no point in advertising file clipping support if
wClipboard failed to initalize any local file subsystem, in which case
we cannot handle files for real. Take a note of this as well when we
register the file formats.

If everthing is really in place and the stars shine upon us then we are
allowed to set CB_STREAM_FILECLIP_ENABLED in the capabilities. There is
no command line switch to disable file clipping (and there is little
reason to), so we always support it if we can.

We also set an additional flag CB_FILECLIP_NO_FILE_PATHS flag in the
capabilities because it seems to be necessary for the server to send the
"FileGroupDescriptorW" format to us. Otherwise the server will only send
the old CF_HDROP format which can't be handled well without enabled disk
drive redirection and a properly negotiated server-side temporary
directory.
2017-04-09 03:15:49 +03:00
ilammy 401bf8b0af x11/cliprdr: provide file content to the server
xf_cliprdr_server_file_contents_request() handles the
CLIPRDR_FILECONTENTS_REQUEST which is sent by the server to retrieve the
size or data of a single file. The server can only request one of these
things at a time, do confirm this.

The actual handling of the requests is done by wClipboardDelegate. In
order to handle its resposes we register a bunch of our own callbacks
which simply pass the responses to the server.

In case of an error we should always send a CB_RESPONSE_FAIL to the
server. If we do not then the file transfer progress dialog may end up
hanging in the remote session forever until the user logs out or kills
explorer.exe. We do wnat this.
2017-04-09 03:15:49 +03:00
ilammy 5fb89985f0 x11/cliprdr: handle text/uri-list format
To handle a new format we should first be able to transform the format
name from the local clipboard owner into its remote representation. In
our case this will be trasforming the "text/uri-list" target into the
"FileGroupDescriptorW" named format.

Add CB_FORMAT_TEXTURILIST to identify the local format by its ID during
the data conversion step. This numeric ID has nothing to do with the ID
which will be sent to server. It's a bit weird, but that's how XFreeRDP
works.

After that add a new client format with this ID and appropriate local
and remote format names (in atom and formatName fields respectively).
Do this only if wClipboard actually supports "text/uri-list" format.
(It could fail to initialize the local file subsystem, in which case
it will fail all file-related requests and there would be no point in
advertising the file format support in the first place.)

Finally, handle the actual format data request for a new named format
in xf_cliprdr_process_requested_data(). Remember to convert the
FILEDESCRIPTOR array we receive from wClipboard into the
CLIPRDR_FILELIST expected by the server. Also take care to not leak
memory during this conversion.

Note that this handles only the CLIPRDR_FORMAT_DATA_REQUEST. The server
is still not able to retrieve the file content as this is done via a
separate request-reply sequence.
2017-04-09 03:15:49 +03:00
ilammy 96fe94c85f x11/cliprdr: impove error handling
Unify error handling in xf_clipboard_new() by using a common cleanup
code path. This fixes a leak of clipboard->system and format names when
an error occurs during initialization.

Also reformat the code to fit into 100 column limit without this line
break insanity and with improved readability.

I do not particularly like to use a variable with such a descriptive
name 'n' far away in the error handling part, but its short name is
kinda important for readability so let's keep it as is.
2017-04-09 03:15:49 +03:00
Armin Novak bba910bd85 Fixed RPATH settings for OS X 2017-04-06 08:08:07 +02:00
Armin Novak 850d7fbc38 Update changed rectangles instead of extent. 2017-03-30 18:17:21 +02:00
Armin Novak 09d43a66f4 Fixed tests and dead store warnings. 2017-03-28 16:49:56 +02:00
Armin Novak 197378975b Let bitmaps keep XBitmap during lifetime. 2017-03-28 12:14:19 +02:00
Armin Novak 73bf4547a5 X11 GFX: Restrict to region, ignore alpha
* Restrict the screen update to the changed region
* Ignore differences in color format alpha
2017-03-28 12:14:19 +02:00
Armin Novak d46d0c3d4a Fixed invalid return from xf_rail_window_icon 2017-03-28 11:47:46 +02:00
Norbert Federa fa2086686b some performance fixes
- draw only the updated region in the gdi and x11 surface bits implementation
- don't repeatedly call IsProcessorFeaturePresentEx in rfx rlgr decoder
- fix ugly and unaligned profiler print layout and remove an unnecessary value
2017-03-27 20:14:13 +02:00
Armin Novak 8c687611af Print logon error info. 2017-03-17 13:48:32 +01:00
Armin Novak 6b3048b85b Cleaned up database access code. 2017-03-13 12:05:49 +01:00
Armin Novak f5e6aebb31 Using plain HTTP links for freerdp.com 2017-03-13 09:21:07 +01:00
Armin Novak 5546da2932 Readded css for phone layout. 2017-03-09 15:08:01 +01:00
Armin Novak 5f3dbc3784 Fixed help pages. 2017-03-09 13:55:19 +01:00
Armin Novak 2e9cb0f3ea Fixed keyboard show/hide 2017-03-09 13:55:05 +01:00
Armin Novak 91be74e0d6 Removed unused strings, translated missing ones. 2017-03-09 11:07:59 +01:00
Armin Novak 6f57b090a6 Validating advanced and screen settings. 2017-03-09 11:07:59 +01:00
Armin Novak d8858cf19f Validating advanced settings before use. 2017-03-09 11:07:59 +01:00
Armin Novak a595602953 Updated gradle and config printout. 2017-03-09 11:07:59 +01:00
Armin Novak ed5b81a807 CSS to external file, fixed license linebreaks. 2017-03-09 10:01:36 +01:00
Norbert Federa 540bfe97df Merge pull request #3845 from akallabeth/afreerdp_db_upgrade
Afreerdp db upgrade
2017-03-08 09:35:52 +01:00
Armin Novak 589114593c Async transport removed, H264 check for support. 2017-03-07 16:09:24 +01:00
Armin Novak f866d60c2c Validating log level. 2017-03-07 15:08:24 +01:00
Armin Novak ade4bfcd3c Fixed issues with database upgrade code. 2017-03-07 14:50:52 +01:00
Armin Novak 1f1dae79e6 Fixed cursor empty checks. 2017-03-07 13:17:37 +01:00
Mariusz Białończyk 3e8446f11b Manual: remove a space in examples 2017-03-06 14:28:30 +01:00
Norbert Federa f77b4a57dc Merge pull request #3796 from akallabeth/scan_warning_fixes_v2
Scan warning fixes v2
2017-03-03 14:41:11 +01:00
Armin Novak 03f3f061b7 Fixed disconnect handling. 2017-03-03 12:06:37 +01:00
Armin Novak b2c29158be Scanbuild warning, argument checks and leak fixes.
* Added Stream_GetRemainingCapacity to check remaining stream size
  before writes.
* Fixed shadow server memory leak.
* Fixed lots of scanbuild warnings
* Added missing argument checks in many functions
* Added missing static function declarations
2017-03-02 18:13:43 +01:00
Armin Novak e1cfec1f6d Added missing translations for color enumeration. 2017-03-02 13:06:10 +01:00
Armin Novak 93cd763815 Removed https links in MPL and apache license. 2017-03-02 12:48:13 +01:00
Martin Fleisz 1207fdbff7 Merge pull request #3807 from akallabeth/afreerdp_update
Afreerdp update
2017-03-02 12:26:00 +01:00
Armin Novak c204fbe409 Added client name reset if empty. 2017-03-02 10:27:13 +01:00
Armin Novak 345cbddba7 Updated intent filter to open RDP files. 2017-03-02 08:49:50 +01:00
Martin Fleisz a391a3decc client: Check if channel has already been added 2017-02-24 13:03:03 +01:00
Armin Novak 05f6dac204 Moved construction to onCreate. 2017-02-24 11:30:36 +01:00
Armin Novak eeee92a309 All EditTextPreferences are now single lined. 2017-02-24 09:48:40 +01:00
Armin Novak 37e9db4b04 Added signing configuration. 2017-02-24 09:29:26 +01:00
Armin Novak 65f761a587 Use HTTPS links in about. 2017-02-23 15:20:19 +01:00