Commit Graph

227 Commits

Author SHA1 Message Date
Armin Novak
707b9348ee Unify encomsp request control code 2022-09-13 09:22:41 +02:00
akallabeth
9a2a37786e Refactored clipboard structs 2022-07-04 14:31:08 +02:00
akallabeth
ebf5de1d1d Preset LoadChannels function pointer 2022-06-29 09:18:53 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth
650a275ceb Added new client callback LoadChannels and freerdp_client_load_channels
Split channel loading from PreConnect as it might be necessary to
reinitialize channels on redirect
2022-06-23 07:45:55 +02:00
David Fort
77413f49b2 winpr: rework alignment functions
_align_XXX functions aren't widely available depending on the C runtime. That causes
problems with mingw where we can easily have some runtime mixes (which lead to mysterious
segfaults most of the time). This patch introduce winpr_aligned_XXX functions that will
either use the function available, or use an emulation layer.
2022-05-12 11:36:01 +02:00
akallabeth
d68327ad74 Fixed const correctness of pPointer_Set
Pointer might need to be modified
2022-04-28 09:17:20 +02:00
akallabeth
73cdcdfe09
Logging and parser fixes (#7796)
* Fixed remdesk settings pointer

* Fixed sign warnings in display_write_monitor_layout_pdu

* Use freerdp_abort_connect_context and freerdp_shall_disconnect_context

* Added and updates settings

* info assert/dynamic timezone

* mcs assert/log/flags

* Fixed and added assertions for wStream

* Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function

* Cleaned up PER, added parser logging

* Cleaned up BER, added parser logging

* log messages

* Modified Stream_CheckAndLogRequiredLengthEx

* Allow custom format and options
* Add Stream_CheckAndLogRequiredLengthExVa for prepared va_list

* Improved Stream_CheckAndLogRequiredLength

* Now have log level adjustable
* Added function equivalents for existing logger
* Added a backtrace in case of a failure is detected

* Fixed public API input checks
2022-04-19 14:29:17 +02:00
akallabeth
14568872a9
Instance cleanup (#7738)
* Cleaned up freerdp::autodetect

* Deprecate freerdp::input

* Deprecated freerdp::update

* Deprecated freerdp::settings

* Deprecated freerdp::autodetect

* Removed rdpTransport::settings

* Deprecated freerdp_per::update|settings|autodetect

* Fixed mac client and server compilation

* Fixed windows compilation

* Added deprecation warnings

* Fixed initialization of structs.

* Fixed android build

* Fixed freerdp_client_context_new const correctness

* Fixed checks for android implementation

Replaced checks with assertions where appropriate

* Fixed checks for windows client

Replaced checks with assertions where appropriate

* Fixed proxy client pointer dereference
2022-03-23 13:18:35 +01:00
Armin Novak
71aac852d6 Remove async-input from clients 2022-03-08 15:37:19 +01:00
Armin Novak
4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak
b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
Armin Novak
b46d74806e Removed FreeRDP_ListSmartcards setting
* Directly print smartcard list without intermediate setting
* Centralize the help text, clients do not need to add extra code
2022-02-24 08:52:25 +01:00
David Fort
cb351a099d Enable smartcard NLA logon 2022-02-24 08:52:25 +01:00
akallabeth
700d6dcd9e Use client/common mouse functions 2022-02-22 09:44:13 +01:00
akallabeth
b2b70fcf6d Use common client channel handling 2022-02-22 09:44:13 +01:00
akallabeth
cdbfff87ea Unified client stop 2022-02-22 09:44:13 +01:00
akallabeth
7641710f60 Use a client/common context component
* Allows moving common client code from specific client to a
  generic client/common implementation
2022-02-22 09:44:13 +01:00
Sumir Jha
3d77496fbb memory grows over time in wlfreerdp with /gfx:AVC44 fixed. 2022-02-15 10:58:41 +00:00
akallabeth
8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
Armin Novak
b9cfa10513 Fixed some more warnings 2022-01-31 15:55:10 +01:00
Armin Novak
2e17cee5a9 Fixed various warnings. 2022-01-31 15:55:10 +01:00
akallabeth
e6e6ed5dbd Cleaned up PubSub
* Callback arguments now const
* Fixed missing includes
2022-01-19 09:24:57 +01:00
akallabeth
b8a48ae83b Fixed #7549: Fix broken wayland event type check 2022-01-13 16:44:12 +01:00
Armin Novak
d0986489dd Fixed leaks and type mismatches for wayland client 2022-01-11 12:47:05 +01:00
Armin Novak
3700ccbfc8 Fixed #7520: remove trailing '\0' from clipboard data 2022-01-10 10:00:19 +01:00
akallabeth
4a4d783d4f
Moved clipboard custom context checks to implementation (#7501) 2021-12-17 13:47:20 +01:00
Marek Vasut
1a1056d76d client: wayland: Fix mouse event fallback pointer flags
In either case of wlf_handle_touch_up()/wlf_handle_touch_down(), the
UINT16 flags are set to fixed values, so there is little reason for
checking presence of specific flag in them again. The conditional is
always true no less, so just call freerdp_input_send_mouse_event().

Moreover, the flags submitted to the remote are wrong. The code should
send BUTTON1/DOWN/MOVE on wlf_handle_touch_down(), so the remote would
pick not only the button down event, but also the coordinate update,
else the remote would receive a mouse click at the wrong coordinates.
The wlf_handle_touch_motion() should update the pointer location too,
make it send plain MOVE event.

Signed-off-by: Marek Vasut <marex@denx.de>
2021-11-29 15:47:23 +01:00
Marek Vasut
487894b5bb client: wayland: Move RDPEI assertion past RDPEI availability check
The wlf_handle_touch_down() implements fallback to mouse event submission
in case RDPEI is not available. This fallback is currently never reached,
because the WINPR_ASSERT(rdpei); triggers before the fallback conditional
is reached.

Move the WINPR_ASSERT(rdpei); after the RDPEI availability check to permit
the fallback to do its job.

Signed-off-by: Marek Vasut <marex@denx.de>
2021-11-29 15:47:23 +01:00
Guillaume Démurgé
8e334d3bfd Added app_id on wayland client 2021-11-12 15:58:39 +01:00
Armin Novak
17d40edf5b Added /video support for wayland client 2021-10-18 10:53:05 +02:00
akallabeth
6ea5823a16 Fixed #6722: Wayland client mouse coordinates
The function scale_signed_coordinates did use addresses instead of
values
2021-10-14 12:11:44 +02:00
Armin Novak
b336751861 Fixed AuthenticateEx issues 2021-09-09 08:53:20 +02:00
akallabeth
a485306c9e
Moved global static variables to context (#7264)
xfreerdp and wlfreerdp used global static variables for multitouch input. Use fields in client context instead.
2021-09-01 09:44:11 +02:00
Armin Novak
c073ca8ac8 Use MAXIMUM_WAIT_OBJECTS 2021-08-25 13:41:38 +02:00
Armin Novak
5afa592244 Fixed cast-qual warnings 2021-08-24 11:10:51 +02:00
Armin Novak
f515bd4560 Fixed shadowing and type errors 2021-08-24 10:45:57 +02:00
akallabeth
242f1734ec Fixed dpkg-buildpackage warnings 2021-06-30 11:57:23 +02:00
Armin Novak
8ef57bf296 Replaced CMAKE_[SOURCE|BINARY]_DIR with PROJECT_[SOURCE|BINARY]_DIR
Thanks @Pollux42 for the hint in #7096
2021-06-22 08:54:18 +02:00
akallabeth
b453d5e40e Fixed rdtk, uwac and winpr standalone builds 2021-06-22 08:54:18 +02:00
Armin Novak
2e0d1cc33c Fixed integer warnings, fixed data types 2021-06-17 10:35:22 +02:00
Armin Novak
299c962b28 Fixed warnings 2021-06-17 10:35:22 +02:00
Armin Novak
670cf8512b Fixed missing return value checks 2021-06-16 11:46:42 +02:00
Armin Novak
d6c84c28fb Renamed ArrayList_Add to ArrayList_Append
* Do not break API silently
2021-06-16 11:46:42 +02:00
Ondrej Holy
892cbe3261 Fix various memory leaks reported by Coverity
Covscan report contains various memory leak defects which were marked
as important. I have spent some time analyzing them and although they
were marked as important, most of them are in error cases, so probably
nothing serious. Let's fix most of them anyway. The rest are false
positives, or too complicated to fix, or already fixed in master, or
simply I am unsure about them.

Relates: https://github.com/FreeRDP/FreeRDP/issues/6981
2021-04-27 14:25:20 +02:00
Max Roncace
e2920d7259 Wayland client: Disable shortcut inhibition on rctrl press 2021-04-08 09:23:58 +02:00
akallabeth
10a595164d Proper pointer event handling for wayland 2021-03-03 11:49:24 +01:00
Max Roncace
bf9bce2c3e Fix /monitor-list flag being ignored on X11/Wayland 2021-02-25 11:47:18 +01:00
akallabeth
43311130a2 Fixed CodeQL warnings 2021-02-19 11:19:49 +01:00
Pascal Nowack
1087a5e1a6 clients: Use the correct wheel rotation value
For the negative scrolling direction, RDP uses the two's complement,
instead of the positive wheel value with the negative flag.
xfreerdp currently uses the positive wheel value in addition to the
negative flag, which results in a wrong wheel value on the server side
(136 instead of 120).

Fix this, by using the correct wheel rotation value, which is in the
two's complement.
2021-02-11 09:54:03 +01:00
Martin Fleisz
21158c0e8b
Merge pull request #6537 from akallabeth/kbd_remap
Added option to remap scancodes
2021-02-05 09:31:45 +01:00
akallabeth
25ab8c8b9c Added wayland discrete axis events for mouse wheel
the discrete axis event gives changes in steps just like the
xfreerdp version uses. This way scrolling can be implemented
consistent with the behaviour of xfreerdp
2021-02-04 21:21:57 +01:00
0140454
79606a9abf Sync numlock, capslock state in Wayland 2021-02-04 21:21:27 +01:00
0140454
96ff661008 Process close event 2021-02-04 09:15:38 +01:00
Ondrej Holy
d7566f5f5a
client: Fix exit codes for /help and similar option (#6741)
* client: Fix exit codes for /help and similar option

Currently, non-zero exit code is returned for /version, /buildconfig, /help,
/monitor-list, /kbd-list and /kbd-lang-list command-line options for several
clients. This is against conventions because 0 is usually returned in
such cases. Also, there is potentially another problem that the returned
codes overflow on UNIX systems (where the exit code is a number between 0
and 255). Let's fix the clients to return 0 in the mentioned cases to honor
conventions and 1 for the command-line parsing errors (or -1 for clients
who already use that value).

Fixes: https://github.com/FreeRDP/FreeRDP/issues/6686

* Refactored freerdp_client_settings_command_line_status_print_ex

Now returns 0 if help or version information was requested.

* Do not eliminate original error status.

Co-authored-by: akallabeth <akallabeth@posteo.net>
2021-01-22 09:44:55 +01:00
Armin Novak
d7bf6553c5 Added option to remap scancodes 2020-10-29 18:44:32 +01:00
akallabeth
f282c55c7a Added clipboard CB_HUGE_FILE_SUPPORT_ENABLED flag 2020-09-29 09:03:49 +02:00
Martin Fleisz
3753f0ea9c Implement gateway message callback for Windows, Wayland and X11 clients 2020-08-04 15:58:48 +02:00
Martin Fleisz
152bf0cda4
Merge pull request #6284 from akallabeth/wayland
Lock wayland buffer updates
2020-06-19 11:44:28 +02:00
akallabeth
c902f583d0 Fixed missing lock during buffer submit. 2020-06-18 08:42:24 +02:00
akallabeth
7361f75d11 Lock wayland buffer updates 2020-06-15 15:49:21 +02:00
Ondrej Holy
ac114d45c7 wlfreerdp: Fix array overrun
This fixes the following defects reported by covscan tool:
 - client/Wayland/wlf_input.c:251: overrun-local: Overrunning array "contacts" of 10 32-byte elements at element index 10 (byte offset 351) using index "i" (which evaluates to 10).
 - client/Wayland/wlf_input.c:308: overrun-local: Overrunning array "contacts" of 10 32-byte elements at element index 10 (byte offset 351) using index "i" (which evaluates to 10).
 - client/Wayland/wlf_input.c:360: overrun-local: Overrunning array "contacts" of 10 32-byte elements at element index 10 (byte offset 351) using index "i" (which evaluates to 10).
 - client/Wayland/wlf_input.c:251: error[arrayIndexOutOfBounds]: Array 'contacts[10]' accessed at index 10, which is out of bounds.
 - client/Wayland/wlf_input.c:308: error[arrayIndexOutOfBounds]: Array 'contacts[10]' accessed at index 10, which is out of bounds.
 - client/Wayland/wlf_input.c:360: error[arrayIndexOutOfBounds]: Array 'contacts[10]' accessed at index 10, which is out of bounds.
 - client/Wayland/wlf_input.c:246: uninit_use_in_call: Using uninitialized value "y" when calling "wlf_scale_coordinates".
 - client/Wayland/wlf_input.c:246: uninit_use_in_call: Using uninitialized value "x" when calling "wlf_scale_coordinates".

The maximal number of touches can be higher then 10, see:
https://wayland.freedesktop.org/libinput/doc/latest/touchpads.html

Let's increse the MAX_CONTACTS count and add checks to prevent usage of
uninitialized values.
2020-06-04 07:55:12 +02:00
akallabeth
cbee45aace Fixed clipboard 'called with invalid type' warning 2020-05-06 13:31:57 +02:00
akallabeth
79522d7e2f Fixed primary monitor index for wayland fullscreen 2020-05-05 10:31:26 +02:00
akallabeth
77b38d9375 Fixed #6087: Inconsistend scroll on wayland
Thanks to @yol and @SaschaWessel a bug in scroll step conversion
was uncovered. The RDP value ranges are inverted when scrolling
in negative direction.
2020-05-04 08:57:56 +02:00
Sascha Wessel
9867793d07 wlfreerdp/cliprdr: Initialize pointer before use
In `wlf_cliprdr_server_format_data_request()` `ConvertToUnicode()` may return 0
while not allocating memory for `cdata` and not setting `cdata` to a valid
address. In this case, `data` points to a random address.

Settting `cdata` to NULL before calling `ConvertToUnicode()` fixes this issues.
2020-04-26 19:57:50 +02:00
David Fort
1fec2f9498 uwac, wlfreerdp: corrected API for UwacOutput and added monitor listing 2020-04-21 08:12:31 +02:00
Julian Albrecht
d69c106a49 Adds the title options to wlfreerdp 2020-04-14 14:33:44 +02:00
akallabeth
9ef1e81c55 Formatted patch. 2020-03-27 14:16:18 +01:00
Julian Albrecht
7ecce5acbe Adds touch support to wlfreerdp 2020-03-27 14:16:18 +01:00
Armin Novak
829497b313 Made CHANNEL_TSMF optional and deprecated. 2020-02-26 13:56:43 +01:00
Armin Novak
c5e261e066 Added new command line swith for automatich assistance control. 2019-11-25 10:32:55 +01:00
Armin Novak
2691532061 Fixed const correctness of encomsp functions. 2019-11-25 09:39:21 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
kubistika
345cc2a2f5 channels: cliprdr: get rid of duplicated server and client code 2019-10-18 14:20:26 +02:00
kubistika
dff3686642 channels: cliprdr: remove formatDataResp.dwFlags
According to the channel docs, this field is only used in format data
request. Therefore, there's no need to hold it in the response. cliprdr
server code was copy-pasted from client code, therefore this must be
some leftover.
2019-10-18 14:20:26 +02:00
Kenny Levinsen
d27ad43093 uwac: Do not memcpy when we swap drawing buffers
The compositor only samples rects that we damage (and have therefore
been overwritten). As we are doing damage tracking and reporting,
memcpy of our old drawing buffer serves no purpose.
2019-07-30 09:46:57 +02:00
Martin Fleisz
3e2be308eb
Merge pull request #5266 from akallabeth/file_list_synth
Added a proper synthesizer for FileGroupDescriptorW to text/uri-list
2019-05-08 15:05:05 +02:00
Armin Novak
6a8755a763 Added image scaling api for software drawing.
For future GFX channel functions an image scaling function is required.
This moves the implementation from wayland client to core library
and adds support for the much faster SWScale library.
2019-05-07 08:56:29 +02:00
Martin Fleisz
25fc56a625
Merge pull request #5260 from akallabeth/rail_spec_update
Rail spec update
2019-04-29 11:27:26 +02:00
Armin Novak
05901280fe Fixed unused argument warnings. 2019-04-05 09:14:35 +02:00
Armin Novak
8bb83f2526 Fixed sign-compare warnings 2019-04-05 09:14:35 +02:00
Armin Novak
1762cd1acb Fixed unchecked return warning. 2019-04-05 09:14:35 +02:00
Armin Novak
54098ab0b5 Fixed unused variable warnings. 2019-04-05 09:14:34 +02:00
Armin Novak
32ea44c037 Added a proper synthesizer for FileGroupDescriptorW to text/uri-list
The file clipboard delegate needs a base URI to operate on for
systems that are not WIN32. Added that to the context and abort
conversion, if that is not set. (currently not fully implemented)
2019-02-21 16:44:40 +01:00
Armin Novak
0a95e4aa78 Fixed #5262: Vertical mouse wheel direction and whell step
* Vertical wheel uses the inverted direction of horizontal wheel.
* The wheel step is now calculated from the value provided by wayland.
2019-02-20 08:56:36 +01:00
Armin Novak
2a06366de3 Added autoreconnect for wayland. 2019-02-19 14:12:25 +01:00
Armin Novak
fe6296a25f Added support for /smart-sizing:<width>x<height> syntax in wayland client. 2019-02-08 12:49:32 +01:00
Armin Novak
f06b31358f Fixed duplicate log tag definition in wayland client. 2019-02-08 12:11:15 +01:00
Armin Novak
cc050f1413 Fixed conversion range checks and cast for use with cairo 2019-02-08 12:08:30 +01:00
Armin Novak
bb755f1944 Removed unused variables. 2019-02-08 12:08:30 +01:00
Armin Novak
4a3f4ad340 Fixed color format for wayland mouse pointer. 2019-02-08 12:08:30 +01:00
Armin Novak
7413370783 Added mouse pointer scaling. 2019-02-08 12:08:30 +01:00
Armin Novak
8d6a6df48a Implements #5215: Smart sizing using libcairo 2019-02-08 12:08:30 +01:00
Ilya Shipitsin
d1939cfc4f client/Wayland/wlf_cliprdr.c: resolve possible null pointer dereference
found by cppcheck

[client/Wayland/wlf_cliprdr.c:143] -> [client/Wayland/wlf_cliprdr.c:158]: (warning) Either the condition 'clipboard' is redundant or there is possible null pointer dereference: clipboard.
[client/Wayland/wlf_cliprdr.c:163] -> [client/Wayland/wlf_cliprdr.c:178]: (warning) Either the condition 'clipboard' is redundant or there is possible null pointer dereference: clipboard.
2019-02-01 03:50:51 +05:00
Armin Novak
2dab778101 Fixed NULL dereferences and uninitialized values 2019-01-30 16:11:10 +01:00
Armin Novak
5c930dc4aa Fixed compiler warnings #5210 2019-01-29 16:15:33 +01:00
Armin Novak
2418c43cac Fixed pointer image update. 2019-01-29 09:34:30 +01:00
Armin Novak
23fa6b9182 Added mouse cursor callback stubs. 2019-01-29 09:34:30 +01:00
Armin Novak
823411c2f3 Fixed wayland buffer updates
The wayland buffer size always matches the current window size.
That might be different from the actual remote framebuffer size,
to when copying always use the correct strides to avoid distorted
screen content.
2019-01-25 10:49:03 +01:00