Commit Graph

1707 Commits

Author SHA1 Message Date
Pascal Nowack
7fce527cff client/X11: Fix IO errors during server to client file transfer
When receiving a file list, xfreerdp3 rebuilds the content of the FUSE
filesystem.
Since fetching uri-lists can happen during a paste action too, xfreerdp3
caches the content of the last fetched mime type.
However, uri-lists exists in different variations, e.g. nautilus uses a
different mime type, than gnome-terminal does.
Furthermore, FormatLists can also contain other formats in addition to
file lists.
Fetching those contents during a paste operation leads to IO errors in
the paste operation.

In order to fix those errors, cache every mimetype in two hash tables:
One for the raw (unconverted) data, and one for the converted data.
When a content request is received, xfreerdp3 can with the already
cached converted data, directly serve the data.
If the content is not available as cached data, but its source data was
already fetched, use that source data to create the converted data.
Then serve the converted data.
Only if no cached converted data or cached raw data is available, issue
a new FormatDataRequest.
2023-04-17 08:33:53 +02:00
Pascal Nowack
d9fe2df6b5 client/X11: Only serve cached data when format matches
Format lists can contain multiple clipboard formats. When the data for
one is requested, xfreerdp caches it.
When the data for a different format in the same format lists is
requested, xfreerdp cannot use the already cached data, since that data
refers to a different format.
As a result, xfreerdp needs to ask for the data of the now requested
format.

However, this is currently not the case. xfreerdp will just provide the
data of the first request after receiving the last format list.
In order to fix this situation, also save the format id of the last
requested format.
If the format id of the cached data matches the one of the current
request, serve the data from the cached data.
Otherwise, issue a new FormatDataRequest.
2023-04-04 09:05:39 +02:00
Pascal Nowack
1f79eaa831 client/X11: Reintroduce handling for relieving filename restriction
Commit 6492a00959 introduced a way to
relieve the filename restriction, which ensured that file lists
containing files with names, that have characters, which are not allowed
on MS Windows.
This relief handling kicked in, when xfreerdp did not connect to MS
Windows RDS.
Commit d521c7fa74 got rid of any
wClipboardDelegate occurrence in xf_cliprdr.c, which also got rid of the
filename restriction relieve handling.
However, the relief handling was not added back, so do it now.
2023-04-04 09:05:39 +02:00
Armin Novak
3f5b44ba36 [clients] fix wClipboard locking 2023-03-22 16:28:01 +01:00
akallabeth
a360f1ca8c [build] fix a few compiler warnings 2023-03-13 13:04:45 +01:00
Armin Novak
f01aaab35a [client,x11] fix variable shadow 2023-03-07 07:51:52 +01:00
Armin Novak
c016562478 [client,x11] enable XSync with debug builds 2023-03-07 07:51:52 +01:00
Armin Novak
8fdd261d25 [client,x11] install X11 error handler
always install a custom X11 error handler to log the issue and location
in code.
2023-03-07 07:51:52 +01:00
Armin Novak
0b048e247e [client,x11] add Safe_XGetAtomName 2023-03-07 07:51:52 +01:00
Armin Novak
05134dc3a0 [client,x11] log location for wrapped X11 calls 2023-03-07 07:51:52 +01:00
Armin Novak
26d1fff864 [client,x11] wrap XGetWindowProperty
use a logging version of the function to diagnose issues
2023-03-07 07:51:52 +01:00
Armin Novak
87a91eb0c6 [client,x11] wrap XDeleteProperty
wrap function calls to logging version for debugging.
2023-03-07 07:51:52 +01:00
Armin Novak
684558d6d7 [client,x11] wrap XChangeProperty
to debug bug reports occuring only with certain setups wrap the function
call with a logging edition so we have the arguments available in the
log for debugging.
2023-03-07 07:51:52 +01:00
Armin Novak
2eeb5d718a [warnings] Fixed shadow warnings 2023-03-06 10:04:59 +01:00
Armin Novak
3d8cb485f4 [warnings] Fixed strict-prototypes warnings 2023-03-06 10:04:59 +01:00
Armin Novak
d7c55d76df [client,x11] fixed missing NULL check in clipboard 2023-03-05 17:55:28 +01:00
Armin Novak
cc65f5db31 [client,x11] fixed clipboard data cache 2023-03-05 17:55:28 +01:00
Armin Novak
7722961fcc [client,common] simplify file clipboard API 2023-03-05 17:55:28 +01:00
Armin Novak
46f1d141c1 [client,common] fixed winpr clipboard locking 2023-03-05 17:55:28 +01:00
Armin Novak
bfea14a5b1 [cliprdr] deactivate local file paste if not supported
if the file clipboard was compiled without FUSE do not announce the
availability.
2023-03-05 17:55:28 +01:00
Armin Novak
0fb242da7b [client,x11] properly initialize file clipboard 2023-03-05 17:55:28 +01:00
Armin Novak
ba128f4661 [client] move file clipboard to client common 2023-03-05 17:55:28 +01:00
Armin Novak
d521c7fa74 remove wClipboardDelegate 2023-03-05 17:55:28 +01:00
Armin Novak
b2fa6da8d2 [client,x11] fix fuse2 compatibility 2023-02-28 09:47:54 +01:00
Armin Novak
e673405711 [client,x11] split file clipboard to own struct
* split file clipboard to own file
* check for changed file data in cliprdr_file_context_update_data,
  prevents duplidate entries in fuse filesystem
2023-02-28 09:47:54 +01:00
akallabeth
ae8f7c272d [client,x11] fixed clipboard data cache
clean only cached data not the fuse cache if other formats are requested
2023-02-28 09:47:54 +01:00
akallabeth
1ba8d826f8 [client,x11] add some debug logs, fix warnings 2023-02-28 09:47:54 +01:00
akallabeth
3d9969ef65 [client,x11] export x11_event_string 2023-02-28 09:47:54 +01:00
akallabeth
adce7378c3 [core,cache] make protocol caches private
most protocol internal caches do not need to be exposed. this reduces
the public API and allows us to more easily improve/change this during a
release cycle
2023-02-27 17:31:52 +01:00
Armin Novak
f357312584 [utils] term signal cleanup handlers
add functions to register/unregister termination cleanup handlers
2023-02-23 20:28:15 +01:00
Armin Novak
64efb7ecfd [client,x11] fail build on manpage generation
if manpages should be build but dependencies are missing fail the build
2023-02-23 20:28:15 +01:00
Armin Novak
078162616d [client,x11] split clipboard formats
* a format to request
* a local format to convert to
* add logging
2023-02-23 20:28:15 +01:00
Armin Novak
b8a709ccda [client,x11] fixed file clipboard cache
if files are pasted in different file-browser (or e.g. xclip is used)
the data was retrieved in wrong format.
2023-02-21 16:42:54 +01:00
Armin Novak
1522b5aa91 xx 2023-02-21 16:42:54 +01:00
Armin Novak
fe3de9b9bf [client,x11] log fuse_session_loop errors 2023-02-21 16:42:54 +01:00
Armin Novak
68d3bcb99a [clipboard] remove linux specifics from channels/cliprdr.h 2023-02-21 16:42:54 +01:00
Armin Novak
10bf44c112 [client,x11] use fuse_root_id 2023-02-21 16:42:54 +01:00
Armin Novak
ded270e167 [client,x11] fix fuse file list reset 2023-02-21 16:42:54 +01:00
Armin Novak
9b174c50c9 [client,x11] add fuse debug messages 2023-02-21 16:42:54 +01:00
Armin Novak
d694733106 [client,x11] fix fuse detection and use 2023-02-21 16:42:54 +01:00
Armin Novak
5d97a03bf4 [client] auto intialize callbacks
initialize all message/user query callbacks with client_cli_*
2023-02-15 13:34:18 +01:00
akallabeth
ff3c7c82ee [client,x11] fix /gdi:hw drawing. 2023-02-14 09:30:45 +01:00
Armin Novak
641022b795 [logging] remove __FUNCTION__ from actual message
prefer the log formatter to provide that information.
2023-01-25 16:26:39 +01:00
Armin Novak
070353bf90 added SDL2 client 2023-01-10 17:38:00 +01:00
Armin Novak
d66b165b8e [client,common] common touch handling 2023-01-10 17:38:00 +01:00
Armin Novak
d978a0dbdb [client,x11] fix rail checks
rail might be deactivated during connect, so ensure that the default
session rendering path properly checks the window pointer
2023-01-10 11:49:02 +01:00
Armin Novak
2b49047c34 [client] Fix keyboard input
properly pass key repeat events to the server.
2022-12-13 14:37:05 +01:00
Armin Novak
d90aa5d6f5 [client,x11] Fixed #8099: Detect key autorepeat
When a key is pressed in autorepeat mode, skip the KeyRelease events in
between.
2022-12-13 14:37:05 +01:00
akallabeth
d4808dd3e1 Fixed various compiler warnings 2022-12-09 15:58:26 +01:00
Armin Novak
bd7e2263ad fixed const and type cast warnings 2022-12-09 15:58:26 +01:00