Commit Graph

195 Commits

Author SHA1 Message Date
Kimon Hoffmann 8ec4d20616 [cmake] Locate PkgConfig module with find_package() instead of include(FindPkgConfig)
This is the contemporary way of including find modules and including the
find module this way avoids cmake errors in conjunction with
find_package_handle_standard_args().

Signed-off-by: Kimon Hoffmann <Kimon.Hoffmann@lawo.com>
2023-08-21 12:43:56 +02:00
akallabeth 793d80f2c4 [cmake] update ci defaults 2023-08-04 12:59:11 +02:00
akallabeth 8470b6ea26 [cmake] set default build type
set with CACHE STRING FORCE to properly be picked up by configuration
tools
2023-08-04 12:59:11 +02:00
akallabeth 76d23885d4 [cmake] add common options to subprojects 2023-08-04 12:59:11 +02:00
Kai Pastor 5ecc011c13 Export interface include directories 2023-08-01 11:12:46 +02:00
Armin Novak e0aec72d71 [pkg-config] unify exec_prefix 2023-04-24 22:01:15 +02:00
Armin Novak f674b209ff [pkg-config] unify libdir 2023-04-24 22:01:15 +02:00
Armin Novak f0e9797b4c [build] require CMake >= 3.13
required for target_link_options
2023-02-27 11:18:02 +01:00
akallabeth 82ba9ede9c [freerdp] use FREERDP_/UWAC_/RDTK_ prefix for conditional headers 2023-01-10 17:38:00 +01:00
Armin Novak de0c42273e [uwac] add key repeat state to UwacKeyEvent 2022-12-13 14:37:05 +01:00
akallabeth 37ab25e19d Fixed all Wdocumentation warnings 2022-12-12 14:24:55 +01:00
akallabeth d4808dd3e1 Fixed various compiler warnings 2022-12-09 15:58:26 +01:00
Jonas Ådahl 5b09cd57a7 uwac/input: Don't pass hotspot as offset when attaching cursor buffer
Passing a non-zero offset to cursor buffer and then calling
wl_pointer.set_cursor doesn't make much sense, as any offset will
immediately be reset. The protocol specifies the cursor set by
wl_pointer.set_cursor to be

> The parameters hotspot_x and hotspot_y define the position of
> the pointer surface relative to the pointer location. Its
> top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
> where (x, y) are the coordinates of the pointer location, in
> surface-local coordinates.

This leaves no room available for any previously set offsets to be kept
in response to wl_pointer.set_cursor.
2022-11-16 19:17:08 +01:00
Jonas Ådahl b2cf6f5c2c uwac/input: Set the right serial when setting cursor
The serial in wl_pointer.set_cursor must exactly match the one from
wl_pointer.enter, it should not use whatever serial for any input class
is the newest.
2022-11-16 19:17:08 +01:00
Benoît Gschwind 1cf69f04e6 uwac: fix wl_buffer_destroy of wl_cursor buffer
Following the wayland-cursor documentation [1] the buffer created by
wl_cursor_image_get_buffer should not be destroyed. The new code avoid to
destroy it by avoiding to connect the release callback to this buffer.

[1] https://gitlab.freedesktop.org/wayland/wayland/-/blob/main/cursor/wayland-cursor.c#L147-L154
2022-10-19 17:18:07 +02:00
akallabeth bf56a39e6f
Fixed #8090: Duplicate definition of strndup (#8102)
* Fixed #8090: Duplicate definition of strndup

* Moved strndup detection to winpr

Co-authored-by: Armin Novak <anovak@thincast.com>
2022-08-02 09:15:38 +02:00
akallabeth bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth 1aacf504a1 Increase C standard to C11 2022-06-03 08:51:40 +02:00
akallabeth a0ca2b4a6e Add LTO settings 2022-06-03 08:51:40 +02:00
Armin Novak d1f8c00f7b Fixed duplicated symbols 2022-03-03 11:26:48 +01:00
Armin Novak 5e11f0da28 Reorganized UWAC headers 2022-03-03 11:26:48 +01:00
Armin Novak cb27338bf4 Set required C standard to C99 with extensions 2022-02-24 12:31:58 +01:00
Armin Novak fd027d1bf0 Removed BUILTIN_CHANNELS
Building client channels out of tree does not work reliable as the
dependencies can not be easily split. (exceptions may be simple ones
as echo channel)
It does complicate the build system and code though, so remove this
for maintainability reasons.
2022-02-23 10:43:46 +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
Kshitij Kadam 628c465d38 uwac-window: Make ivi surface-id configurable
The ivi surface-id is made configurable by fetching it from the
environment variables. An environment variable IVI_SURFACE_ID needs to
be set to the required surface-id. In case it is not set then the code
will take 1 as the default surface-id.

Signed-off-by: Kshitij Kadam <Kshitij.Kadam@ifm.com>
2022-02-01 09:26:22 +01:00
Kshitij Kadam 8728f52f34 uwac-window: Change protocol selection order
The current order of protocol selection is xdg_base followed by
ivi_application followed by fullscreen_shell. As a result xdg_base
protocol will be selected even if ivi_application protocol is needed.

The order is now changed to ivi_application followed by fullscreen_shell
followed by xdg_base. It is now possible to select any one of the three
protocols by appropriately defining BUILD_IVI and BUILD_FULLSCREEN_SHELL
macro.

Signed-off-by: Kshitij Kadam <Kshitij.Kadam@ifm.com>
2022-02-01 09:26:22 +01:00
dance cbc6b666ae wayland: fixed memory corruption issue (write to free'd memory)
pass window and buffer index to buffer_release listener, so that it
fetches actual pointer to released buffer by wayland, instead of
directly passing a pointer to the UwacBuffer, which could result in
heap-use-after-free
2022-01-27 10:52:02 +01:00
akallabeth 7dedfbb0b0 Added support for getpwuid_r, replaced duplicate code
* Use GetUserNameExA to get current user name when required.
* Add support for getpwuid_r if available
2022-01-25 15:33:04 +01:00
akallabeth f1e6c6b131 Fix #7570: Limit mouse events to positive values
Wayland API might report mouse events slightly outside the window,
clamp the values to that negative coordinates are skipped.
2022-01-24 11:57:22 +01:00
Armin Novak 4b719df371 Fixed #7521: Ensure '\0' termination of clipboard strings 2022-01-10 11:19:28 +01:00
Marek Vasut c1f44721c5 uwac: Fix connection between mouse-less devices
In case the seat has no default_cursor, which happens on client device with
no mouse attached (e.g. tablets), freerdp would fail to connect because it
won't be able to set cursor image. Check for this condition and skip setting
the cursor image.

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 e821c93cc4 Removed duplicate HAVE_PIXMAN_REGION definition 2021-10-14 13:04:59 +02:00
Armin Novak 673fb46836 Fixed uninitialized warnings 2021-09-10 08:16:25 +02:00
Armin Novak 0fe1e2359e Fixed all reserved-id-macro warnings 2021-09-10 08:16:25 +02:00
Armin Novak f515bd4560 Fixed shadowing and type errors 2021-08-24 10:45:57 +02:00
Armin Novak 610396e197 Fixed compilation warnings
Try to get the number of warnings down
2021-08-02 10:28:06 +02:00
Armin Novak ed7e3761f1 Fixed include paths for uwac 2021-06-28 15:06:30 +02:00
Armin Novak 2e42df9515 Fixed HAVE_PTHREAD_MUTEX_TIMEDLOCK 2021-06-28 15:06:30 +02:00
Armin Novak fd08c77f7f Fixed definition of config.h symbols 2021-06-28 15:06:30 +02:00
Armin Novak b11ea98772 Fixed standalone issues with cmake 2021-06-22 09:43: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 cbb39709b9 uwac: Fixed warnings, added assertions 2021-06-18 11:32:16 +02:00
akallabeth 8d82adb28a Fixed warnings 2021-06-17 10:35:22 +02:00
Max Roncace e2920d7259 Wayland client: Disable shortcut inhibition on rctrl press 2021-04-08 09:23:58 +02:00
akallabeth 7f0774c6f9 Increased UWAC version 2021-03-03 11:49:24 +01:00
akallabeth b6b6a81187 Added pointer source events 2021-03-03 11:49:24 +01:00
akallabeth 9ea7f88753 Added pointer frame events 2021-03-03 11:49:24 +01:00
sss 6574fdf6e4 reverted changes from clang-format 2021-02-25 14:05:40 +01:00
Gluzskiy Alexandr bee2e1526d allow to use in single threaded mode
(some client side channels and all server side channels still need to be
ported to new api)

server: build fix, do not disable threads for rfx encoder

cliprdr client channel: implemented support for DisableThreads option
looks like thread does not make sense at all for this channel

do not initialize disabled image codecs (respect settings)

channels: client: rail: added support for DisableThreads setting

changed "BOOL DisableThreads" to "UINT32 ThreadingFlags"
dropped unnecessary apu changes

draft implementation of threading settings aware message handling api
for addins/channels

rail: use new messaging api

fixed memory leak

msgs handlers external api changes (as requested)

msgs_handlers: init fix

fixed memory leak

logic fix

resolved problems appeared after rebase to master, dropped unnecessary
changes

git clang-format origin/master

fixed TestFreeRDPCodecRemoteFX.c

"formatting, run `clang-format` please"

properly use new "rfx_context_new(BOOL, UINT32)" everywhere

passed Threading Flags to "rfx_context_new" where available

in older C standarts veriables declaration must be done before any code

requested changes

clang-format as requested

use broken signatures of standert C functions for m$ s**tos

clang-format

requested changes

requested changes

moved ThreadingFlags to stable api zone

define type for channel msg handler

typo fix

clang-format

build fix

us ThreadingFlags from server settings

git clang-format origin/master

clang-format
2021-02-25 14:05:40 +01:00
akallabeth 43311130a2 Fixed CodeQL warnings 2021-02-19 11:19:49 +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 522c0cb3ad libuwac: Fix code format 2021-02-04 21:21:27 +01:00
0140454 aaefe18f98 libuwac: Add UwacKeyboardModifiersEvent 2021-02-04 21:21:27 +01:00
0140454 30233a4c74 Dont' commit surface in configure handler 2021-02-04 09:15:38 +01:00
0140454 712c5fee97 Fix key repeat in Wayland 2021-01-27 01:22:52 +08: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 1bc48b058f Fixed double free for uwac buffers 2020-06-16 14:26:38 +02:00
Kyle Evans 1b5e234135 uwac: don't try to use O_TMPFILE on FreeBSD
Currently, this sets an invalid open flag and attempts to open(), which
will fail.  Instead of doing that, don't try to define O_TMPFILE where
such a definition can't exist and force the fallback rather than making
an always-fail open() call.
2020-06-08 08:17:25 +02:00
akallabeth 94e38f7285 Increased uwac library version. 2020-05-08 11:04:03 +02:00
akallabeth 9900e52073 Fixed UwacDisplayGetOutput and UwacOutputGetResolution checks
return proper error conditions if arguments are invalid.
2020-05-05 10:29:25 +02:00
Sascha Wessel ff618f53f7 libuwac/input: Fix memory leak
`create_pointer_buffer()` allocates memory with `mmap` and never frees it.

Adding a corresponding `munmap` fixes this issue.
2020-04-29 22:31:02 +02:00
Sascha Wessel 11facf8909 libuwac/window: Fix memory leak / SIGBUS
`UwacWindowShmAllocBuffers()` allocates memory with `mmap` and never frees it
resulting in SIGBUS errors and running out of memory after some time.

Adding a corresponding `munmap` fixes this issue.
2020-04-26 19:19:31 +02:00
David Fort 1fec2f9498 uwac, wlfreerdp: corrected API for UwacOutput and added monitor listing 2020-04-21 08:12:31 +02:00
Fabrice Fontaine 3929226830 src/libuwac/uwac-os.c: fix build with uclibc
O_TMPFILE is used since version 2.0.0 and
52ef8079ea

However, this will result in the following build failure on uclibc or
uclibc-ng:

/home/fabrice/buildroot/output/build/freerdp-2.0.0/uwac/libuwac/uwac-os.c:228:18: error: ‘O_TMPFILE’ undeclared (first use in this function); did you mean ‘EMFILE’?
  fd = open(path, O_TMPFILE | O_RDWR | O_EXCL, 0600);
                  ^~~~~~~~~
                  EMFILE

To fix this build failure, define O_TMPFILE if needed

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-04-10 10:29:28 +02:00
akallabeth 56deba7562 Enforce coding style. 2020-04-09 13:49:10 +02:00
Julian Albrecht 7824f0cee9 Moves variable declaration to beginning of scope 2020-04-09 13:49:10 +02:00
Julian Christian Albrecht 3029e3b2cf Check return value if already a listener is registered 2020-04-09 13:49:10 +02:00
Julian Albrecht 7ecce5acbe Adds touch support to wlfreerdp 2020-03-27 14:16:18 +01:00
Armin Novak 87f5b768a9 Silenced warning due to missing debug define guard. 2020-03-10 14:04:53 +01:00
Armin Novak 7c243da6e1 Remove symbols exported by accident. 2019-12-02 10:57:31 +01:00
Armin Novak 72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Kenny Levinsen 3c18555693 uwac: Only submit dirty buffers 2019-07-30 09:46:57 +02:00
Kenny Levinsen 2548fd4aae uwac: Make damage tracking more readable 2019-07-30 09:46:57 +02:00
Kenny Levinsen 49674d57f6 uwac: Re-enable damage tracking 2019-07-30 09:46:57 +02:00
Kenny Levinsen 4df57d915d uwac: Do not unconditionally set pendingBuffer on configure
If pendingBuffer is set when it was otherwise NULL, then
UwacWindowSubmitBuffer will forever bail early, waiting for a frame
callback that will never come.
2019-07-30 09:46:57 +02:00
Kenny Levinsen 7dda8362e7 uwac: Acknowledge xdg_surface configure messages
This is necessary for the surface to have its role configured.
2019-07-30 09:46:57 +02:00
Armin Novak d91d1edd0c Fixed dead store warnings 2019-04-05 09:14:35 +02:00
Armin Novak de69dd3942 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak 1a46ef2a82 Fixed unused variable warnings. 2019-04-05 09:13:24 +02:00
David Fort cfbf22348e
Merge pull request #5251 from akallabeth/wayland_cursor_handling_fix
Moved wayland cursor handling to seat.
2019-04-04 18:05:28 +02:00
Armin Novak cbeabfa47e Fixed xrealloc argument type
Using a void* as arugment instead of char* removes warnings when
allocating something beside a string.
2019-02-21 11:43:59 +01:00
Armin Novak 073c54a368 Use safe iteration for seat removal. 2019-02-19 09:29:17 +01:00
Armin Novak b0ab577474 Moved wayland cursor handling to seat. 2019-02-13 09:02:15 +01:00
Armin Novak 0d389d09a3 Fix 5243: Allocate buffers zero in uwac. 2019-02-11 11:54:19 +01:00
Armin Novak ce2f2012ae Destroying released cursor buffers. 2019-02-08 15:22:06 +01:00
Armin Novak db3bcffd03 Don't destroy wayland buffer attached to a surface. 2019-02-08 13:42:45 +01:00
Armin Novak b3ffdbbde1 Fixed missing initializer. 2019-02-08 12:08:30 +01:00
Armin Novak 32d539b706 Removed debug messages. 2019-01-29 13:34:27 +01:00
Armin Novak f64db12a2e Fixed uninitialized value. 2019-01-29 11:07:44 +01:00
Armin Novak 2418c43cac Fixed pointer image update. 2019-01-29 09:34:30 +01:00
Armin Novak 52ef8079ea Added O_TMPFILE support for uwac tempfile generation. 2019-01-29 09:34:30 +01:00
Armin Novak 34adfd5714 Added UWAC_EVENT_OUTPUT_GEOMETRY event 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 b1e6e232ee Fixed buffer submit and callback cleanup.
* Buffer submit now ignores duplicate buffer submit again.
* Frame callback is cleaned up in the callback function now.
* Damage region is currently ignored as there are screen artifacts otherwise.
2019-01-25 10:50:07 +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
Armin Novak 0fd27e0e38 Fixed wayland clipboard registration, retry if seat is detected before. 2019-01-25 10:49:03 +01:00