Commit Graph

45 Commits

Author SHA1 Message Date
akallabeth
d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth
0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00
akallabeth
207def5c56 [clang-tidy] readability-isolate-declaration 2024-02-15 11:49:16 +01:00
akallabeth
4e438d1c3e [client] make settings opaque 2023-11-24 14:54:56 +01:00
akallabeth
1b254c17ea [client,wayland] fix cast warnings 2023-02-01 09:51:54 +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
2b49047c34 [client] Fix keyboard input
properly pass key repeat events to the server.
2022-12-13 14:37:05 +01:00
akallabeth
dfb6e9200c Fixed build without RDPEI channel 2022-10-13 14:38:06 +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
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
b8a48ae83b Fixed #7549: Fix broken wayland event type check 2022-01-13 16:44:12 +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
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
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
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
2e0d1cc33c Fixed integer warnings, fixed data types 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
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
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
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
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
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
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
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +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
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
Armin Novak
b2ef3e69ca Fixed Wayland horizontal mouse wheel direction. 2019-01-07 10:02:04 +01:00
Armin Novak
1984f73db8 Implemented horizontal mouse wheel for wayland. 2018-12-18 13:49:13 +01:00
Armin Novak
f647e5cc3f Implemented mouse buttons 4 and 5 for wayland. 2018-12-18 13:49:08 +01:00
Armin Novak
733f58c4f9 Use wrapper functions for input event handling. 2018-03-05 09:59:41 +01:00
Armin Novak
84f2cff5e0 Fixed wayland issues. 2018-02-15 09:44:38 +01:00
Olivier Blin
3e5f8c6bdb Reuse evdev/X11 keymap for wayland 2017-07-05 18:48:24 +02:00
David FORT
ded17d9d0c Move wayland client to UWAC 2016-02-23 14:09:53 +01:00
Norbert Federa
344362a8a3 clients: fix "focus in event" issues
The input->FocusInEvent callback implementations (normal and fast-path) have
always sent the mouse position even if the pointer was outside of the freerdp
client area. In addition xfreerdp used the wrong pointer coordinates which
were relative to the root window instead of its own.
On focus-in the pointer position must only be sent if the pointer is
currently within the program's client area. However, the clients had no way
to pass that information to input->FocusInEvent which required an API change.

- removed mouse pointer x, y parameters from input interface's FocusInEvent
- clients are responsible to call input->MouseEvent on focus-in if necessary
- fixed xfreerdp and wfreerdp accordingly
2015-01-16 18:40:57 +01:00
Manuel Bachmann
a9cf8b5838 wlfreerdp: add keyboard and mouse wheel support, fix bugs
This commit does the following:

* fix the keyboard logic (which now fully works), add support for vertical mouse wheel events ;
* make the rendering a lot more efficient, by using RDP damage information to refresh only the relevant part of the buffer ;
* fix two race conditions. wlfreerdp should not crash anymore now ;
* fix shm_open() and shm_unlink() calls ;
* improve the code style.

Signed-off-by: Manuel Bachmann <tarnyko@tarnyko.net>
2014-11-26 10:46:05 +01:00
Manuel Bachmann
93ff550ae0 wlfreerdp: reorganize source files, add input methods
We split the one massive source file into multiple separate
source files and headers, just like it is done for other
clients.

We add a new "wlfInput" interface which will try to
initialize mouse and keyboard at startup. Mouse inputs
already work, keyboard inputs need further investigation.

Signed-off-by: Manuel Bachmann <tarnyko@tarnyko.net>
2014-11-17 16:42:27 +01:00