* 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
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>
* 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
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
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
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
* 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
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.