Commit Graph

160 Commits

Author SHA1 Message Date
akallabeth
7a71441476 [warnings] fix integer multiplications
Ensure the integer width for size arguments is 64bit in a
multiplication. Leading 64bit constant 1ull expands width, a trailing
one is ignored.
2023-08-22 11:55:00 +02:00
akallabeth
9565ff4b29 [client,x11] restrict pointer move to active window 2023-07-03 10:00:29 +02:00
akallabeth
32b60ae438 [pointer] unify mouse pointer settings 2023-07-03 10:00:29 +02:00
Armin Novak
a4c6b36a19 [build] fix memory sanitizer stack frame warnings 2023-06-07 09:14:45 +02:00
Armin Novak
3e44efc841 [cmake] use FindX11 from CMake 3.13 2023-05-31 11:05:56 +02: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
4008033065 [x11,client] assert use of xfc->depth
Do not use color depth settings before they are initialized
2022-12-09 12:30:14 +01:00
Armin Novak
a489c69f10 [client,x11] Fixed #8397: Clamp scaled cursor sizes
If a cursor is scaled, ensure the result size is at least 1x1 pixel
wide.
2022-11-16 13:47:02 +01:00
akallabeth
43c5289928 Replaced memset/ZeroMemory with initializer
* Addes WINPR_ASSERT on many occations
* Replaced memset with array initializer
* Replaced ZeroMemory with array initializer
2022-10-14 12:11:01 +02:00
Martin Fleisz
d8ac6e978e x11: Fix disconnects if WITH_XCURSOR is set to OFF
Fix disconnects if WITH_XCURSOR is set to OFF. In that case xf_Pointer_New currently returns FALSE causing a disconnect.
2022-09-05 14:12:47 +02:00
David Fort
4fc7a9417d
Various fixes / improvements (#8146)
* xfreerdp: fix typo in logs

* winpr: file appender, small code cleanup

* shadow-server: add an option for TLS secrets

This allows to dissect connections to the shadow server.
2022-08-22 09:42:15 +02:00
akallabeth
2da280b8a1 Fixed compilation warnings 2022-07-04 14:59:21 +02:00
akallabeth
c07d240bc8 Updated pointer debug log messages 2022-07-04 14:30:49 +02:00
akallabeth
b8f3743e82 Update scaled pointer on FocusIn 2022-07-04 14:30:49 +02:00
akallabeth
2c814138cc Fixed xf_Pointer_GetCursorForCurrentScale check 2022-07-04 14:30:49 +02:00
akallabeth
e07233ccef Fixed float comparson 2022-06-29 18:10:33 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth
90ce22283d Replaced direct settings access with getter/setter 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
0422cf9892 Fixed invalid argument types 2022-04-29 14:38:41 +02:00
akallabeth
2dfc1ddb12 Removed obsolete trio 2022-04-28 10:49:09 +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
667b471686 Fixed cast-quality warnings 2022-04-28 09:17:20 +02:00
akallabeth
fb90ac280a Refactored color.h
* Remove implementations from header
* Rename functions to be FreeRDP specific
* Add deprecation define for old names
* Fixed missing includes
2022-04-28 08:40:47 +02:00
Kazuki Oikawa
98f9aedd62 Supports 10bit X11 color (BGRX32 only) 2022-03-20 10:05:18 +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
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
Armin Novak
0f8c52b9ca Fixed const warnings with argument parser 2021-09-09 08:53:20 +02:00
Armin Novak
5afa592244 Fixed cast-qual warnings 2021-08-24 11:10:51 +02:00
akallabeth
242f1734ec Fixed dpkg-buildpackage warnings 2021-06-30 11:57:23 +02:00
akallabeth
618227d751 Fix xf_Pointer_SetPosition with smart-sizing 2021-03-08 14:25:59 +01:00
akallabeth
43311130a2 Fixed CodeQL warnings 2021-02-19 11:19:49 +01:00
akallabeth
50e1c20786 Fixed #6635: Use correct window handle for pointer operations 2021-01-11 15:18:30 +01:00
akallabeth
66dc4cc9ee Fixed compilation warnings. 2020-11-10 08:53:43 +01:00
akallabeth
488ffe31fc Fixed leak on cursor update. 2020-10-05 09:45:45 +02:00
akallabeth
4f8a48d96e Fixed variable declaration in loop 2020-09-22 07:43:56 +02:00
Armin Novak
ddde652460 Fix variable declaration in loop 2020-09-16 09:30:37 +02:00
Nathan Loewen
e24c95f90e X11: Scale cursor when SmartSizing is on 2020-09-14 09:21:33 +02:00
Armin Novak
4530a9a631 Modified xf_lock_x11 and xf_unlock_x11, allow recusive
The X11 locking routines did not handle multiple locks from the same
thread well. This pr fixes that.
2020-03-04 15:50:47 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
e009a62f06 Fixed sign-compare warnings 2019-04-05 09:14:35 +02:00
akallabeth
b6eca4fc54 signed gdi regions to adjust negative coordinates 2018-11-19 12:52:43 +01:00
Armin Novak
c70bf8329f Fixed XPixmap checks. 2018-04-04 10:46:14 +02:00
Armin Novak
2cf10cc359 bitmap free now always deallocating all resources. 2018-02-13 10:18:43 +01:00
Armin Novak
62607e3b02 Fixed accidental free of XImage data. 2018-02-12 12:44:51 +01:00
Armin Novak
7c0a33632b Fixed #4412: XImage must be freed with XDestroyImage 2018-02-12 10:02:35 +01:00
Ondrej Holy
3137caebf2 Fix colors on big endian (#4135)
* client/x11: Fix colors on big endian

The bitmaps are recieved in little endian byte order (LSBFirst in terms
of X11). This is a problem on systems, where bitmaps are expected in big
endian byte order (MSBFirst). X11 client tries to handle this situation
by different color formats (e.g. RGBX vs. BGRX), but this doesn't work.
BGRX is not MSBFirst variant of RGBX, it should be XRGB. But this would
work only for 32/24 depths, where color channels matches bytes. Let's
say to the XServer that all the bitmaps are in LSBFirst encoding instead
of changing the color formats on big endian systems.

https://github.com/FreeRDP/FreeRDP/issues/2520

* client/x11: Fix cursor color on big endian

The cursor color is wrong on big endian systems. It is not probably
possible to force bitmap_order for XcursorImage as it is possible for
XImage. Fortunately, cursors are always 32 bit so we can use ABGR
instead of BGRA to deal with.

https://github.com/FreeRDP/FreeRDP/issues/2520

* client/x11: Fix comment indentation

The comment has wrong indentation for some reason, let's fix it.

* client/x11: Fix BGR vs. RGB detection

The BGR vs. RGB detection code is leftover from history and I am conviced
that it is wrong with the current color handling, where invert flag is TRUE
by default. However, I suppose that the detection still makes sense and
XServer may use the inverted formats in some cases. Maybe we can force XServer
to use our masks somehow, but let's just fix the value to FALSE now.

* client/x11: Remove unused color shifts

The color shifts are lefover from history and are not used in current
code. Let's remove them.
2017-09-18 10:47:56 +02:00
Ondrej Holy
4239660e34 client/X11: Check arguments in xf_Bitmap_SetSurface
Arguments of xf_Bitmap_SetSurface are not checked before use currently
which may lead to segfaults. It may happen if bitmap is not found in a
cache from some reason. Let's check the arguments before use similarly
as it is done in client/Windows/wf_graphics.c in order to avoid segfaults.

https://github.com/FreeRDP/FreeRDP/issues/4117
2017-09-07 09:38:44 +02:00
Armin Novak
dd4b5ea126 Disable JPEG codec support if not compiled in. 2017-07-24 15:23:36 +02:00