Commit Graph

5047 Commits

Author SHA1 Message Date
efea17a5fe [client,SDL] Handle window sizing on scaled displays 2026-03-04 17:48:09 +09:00
Armin Novak
782c3d3069 [client,common] check _fseeki64 return
propagate error conditions back the call chain
2026-03-03 17:15:12 +01:00
Armin Novak
17163d3738 [winpr,collections] fix PubSub_OnEvent return checks
* proper return checks on use
* fix return on invalid input arguments
* fix return on no event registered
2026-03-03 13:49:54 +01:00
Armin Novak
75d8f295b4 [checks,return] Fix missing *_foreach return checks
* Check HashTable_Foreach return
* Check ArrayList_ForEach return
2026-03-03 11:07:59 +01:00
Armin Novak
b724ba546d [checks,return] fix various unchecked return values 2026-03-03 09:40:27 +01:00
Armin Novak
212d4d5e29 [client,common] add return checks 2026-03-02 18:32:38 +01:00
Armin Novak
4ff57b68c2 [client,x11] refactor locking
X11 and railWindows lock must be held at the same time to avoid
deadlocking.
2026-03-01 09:23:42 +01:00
Armin Novak
5b4fae7afb [client,sdl] ignore input events unless connected
Ignore events that occur while the client is not fully connected.
2026-03-01 08:02:42 +01:00
Armin Novak
0445ed6734 [winpr,pubsub] check return of PubSub_Subscribe 2026-02-27 15:52:32 +01:00
Armin Novak
89ab3c6c1b [nodiscard] Fix all winpr_RAND usages
* Check return value and act on it.
* Initialize arrays that were missed before.
2026-02-27 15:52:26 +01:00
Armin Novak
78fd7f580d [client,x11] improve rails window locking
* Add unified lock/unlock functions to allow easier tracing
* Fix a few locking issues found during debugging
* Add an assertion triggering when a lock is locked/unlocked twice
2026-02-27 10:56:12 +01:00
Armin Novak
465a6353d5 [c23,client] replace NULL with nullptr 2026-02-26 15:42:59 +01:00
Armin Novak
e58819830a [c23] simplify boolean checks 2026-02-26 11:51:05 +01:00
Armin Novak
0531803808 [warnings] make function declaration names consistent
Use the same parameter names for declaration and implementation.
2026-02-26 10:35:25 +01:00
Armin Novak
6ac6eaec9b [client,sdl] remove multimonitor warning 2026-02-25 19:39:28 +01:00
Armin Novak
48267edf2f [winpr] add WINPR_C_ARRAY_INIT
since C23 allows c++ style initializing replace direct use with this
macro
2026-02-25 19:23:08 +01:00
Armin Novak
3fcc287b16 [warnings] initialize all va_list 2026-02-25 07:41:39 +01:00
Armin Novak
4b14749013 [client,x11] use element compare
the structs do not have a stable binary representation, compare element
by element.
2026-02-25 07:41:36 +01:00
Armin Novak
9e7aaa9bbc [client,x11] fix debug warnings 2026-02-24 16:23:15 +01:00
Armin Novak
15c9fd0300 [client,x11] typedef x11_keysym_scancode_t 2026-02-24 11:03:45 +01:00
Armin Novak
514f0f4ce4 [client,windows] fix missing include 2026-02-24 09:39:03 +01:00
Armin Novak
9a1229de37 [client,windows] register signal handler 2026-02-24 09:26:37 +01:00
akallabeth
86d8bf840d Merge pull request #12340 from akallabeth/smartcard-stop-fix
Smartcard stop fix
2026-02-23 17:06:12 +01:00
Armin Novak
31e1f17f03 [client,x11] sort keyboard lookup lists 2026-02-23 16:15:43 +01:00
tiemio
e9b71caa09 [client,x11] add keysym-based fallback for keyboard mapping
When using X11 forwarding from non-standard X servers (e.g. XQuartz,
Xephyr), the XKB key names reported by the remote server do not match
the expected evdev names, causing all keys to map to RDP_SCANCODE_UNKNOWN.

Add a keysym-to-scancode lookup table as fallback. Unlike XKB key names,
keysyms are standardized across X11 implementations. The fallback only
fills keycodes that remain unmapped after the XKB pass, so standard
setups are unaffected.

Tested with X11 forwarding from Exegol (Docker) via XQuartz on macOS,
and natively on Linux and macOS.

Related to #4215

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:15:43 +01:00
Armin Novak
55f6827f6d [client,common] filter some error codes from reconnect
Credential and account errors are most likely related to a permanent
error server side. Do not try to reconnect.
2026-02-23 11:55:33 +01:00
Armin Novak
5f62aa11c1 [client,sdl] fix sdl_Pointer_New
reset ptr->data after free.
2026-02-23 08:52:01 +01:00
Armin Novak
0caa0fb4f6 [client,sdl] make logging less verbose 2026-02-20 10:04:41 +01:00
Armin Novak
db3dcf57b1 [client,x11] fix XGetWindowProperty return handling 2026-02-19 21:59:15 +01:00
Armin Novak
5475aeecf1 [client,common] fix mask for freerdp_client_handle_touch 2026-02-18 13:23:48 +01:00
Armin Novak
d20f9af0e8 [client,sdl] fix single window dynamic screen updates 2026-02-17 16:38:35 +01:00
Armin Novak
66d84e7f45 [client,sdl] fix a memory leak on startup 2026-02-17 16:14:15 +01:00
akallabeth
1b744c15fe Merge pull request #12319 from akallabeth/grow-reasonable
[allocations] fix growth of preallocated buffers
2026-02-17 15:23:17 +01:00
Armin Novak
118afc0b95 [allocations] fix growth of preallocated buffers
* Replace * 2 with * sizeof(WCHAR) for string usages
* Grow streams and other buffers reasonably, e.g. add 128 elements per
  try and check for possible overflows
* Add constant postfix to force them to 64bit
2026-02-17 13:54:34 +01:00
Armin Novak
c4a0565342 [client,x11] fix xf_DeleteSurface error branch 2026-02-17 11:10:16 +01:00
Armin Novak
df64d00a97 [warnings,api] fix -Wunused-result
With marking publid API [[nodiscard]] some problematic error checks in
the core library were uncovered. This commit addresses these
shortcomings.
2026-02-17 11:07:08 +01:00
Armin Novak
f4b0549c5b [client,warnings] properly handle function return 2026-02-16 09:18:38 +01:00
Armin Novak
9ecfb268fe [freerdp,client] mark function pointers [[nodiscard]] 2026-02-16 09:18:35 +01:00
Wladimir Kirjanovs
31346e9024 [android] Fix invert scrolling default value mismatch
The `getInvertScrolling()` fallback default was `false`, while
the XML preference in `settings_app_ui.xml` defines `android:defaultValue="true"`.

On a fresh install, if `PreferenceManager.setDefaultValues()` has not yet
persisted the XML defaults into SharedPreferences, the fallback value
`false` is returned instead of the intended `true`. This causes the
"Invert Scrolling" option to appear checked in the UI but not actually
take effect until the user toggles it manually.

Change the fallback from `false` to `true` to match the XML default.

Fixes #12308
2026-02-15 18:25:28 +01:00
Armin Novak
1ac24accf0 [client,sdl] fix move constructor of SdlWindow 2026-02-14 20:35:25 +01:00
akallabeth
0ff34a1124 Merge pull request #12217 from akallabeth/sdl-fs
Sdl fullscreen
2026-02-14 12:20:03 +01:00
Armin Novak
52cd988410 [client,sdl] fix cursor surface creation
* Pass the pixel width and height to SDL_CreateSurface
* Pass display scaled hotspot to SDL_CreateColorCursor
2026-02-14 10:06:12 +01:00
Armin Novak
3503be620a [client,sdl] log cursor scale 2026-02-14 10:03:01 +01:00
Armin Novak
07bf4e9c10 [client,sdl] improve cursor updates
* use std::unique_ptr for temporary SDL_Surface (ease up cleanup)
* better logging of errors (add full surface details)
2026-02-14 10:02:57 +01:00
Armin Novak
1b577a755e [client,sdl] add toString for SDL_Rect 2026-02-14 09:44:47 +01:00
Armin Novak
62c10e59d8 [client,android] fix platform dependent jlong size
always cast to int64_t to avoid format string issues.
2026-02-13 19:54:26 +01:00
Armin Novak
da71c28c9c [client,sdl] create a map of pixel coordinates
We need pixel coordinates for each monitor, but SDL may return logical
coordinates depending on HighDPI mode used by the system.
This commit does:
* Detect which HighDPI mode is in use isHighDPIWindowsMode
* Creates a map of pixel coordinates for each monitor
  * recreated whenever a monitor changes)
  * Updates the window rdpMonitor data for existing windows
2026-02-13 19:24:15 +01:00
akallabeth
3cb88eefd6 [client,sdl] detect displays on startup before RDP
do a simple display query on main SDL thread before starting RDP.
This way the required rdpMonitor details are already available when the
monitor layout or desktop resolution must be sent to the server
2026-02-13 19:24:15 +01:00
akallabeth
e2dd2eedab [client,sdl] implement display detection handling
* SdlContext::detectDisplays to create a initial list of displays and
  their rdpMonitor configuration
* SdlContext::getDisplays to query a SDL_DisplayID at runtime
* SdlContext::getDisplayIds to query available SDL_DisplayID at runtime
2026-02-13 19:24:15 +01:00
akallabeth
efa15e1dc2 [client,sdl] implement a static SdlWindow::query function
The display settings can not be proplerly queried by SDL without a
window. Create a temporary, invisible window for a requested monitor and
query the required details from that window.
2026-02-13 19:24:14 +01:00