This commit adds the variables fv1_select and default_dpi to
xrdp.ini. These variables allow for a different font to be
loaded, depending on the DPI of the login screen.
The dimensions from xrdp.ini are replaced with scaled and unscaled
versions. The unscaled versions are read from the config file, and
then scaled to match the loaded font.
Currently this has no significant effect, as the same font is still
loaded, so the scaling factor is 1.00. However, when a different font
is loaded, the login window can be made larger for use on higher DPI
monitors.
The previous commit added utilities which work with fv1 files
with additional fields in the fv1 header (i.e. body_height and
min_descender). This commit makes minor changes to the font loading code
in xrdp so xrdp can read the new font format.
To generate new fonts, the freetype2 library is required. This
can now be specified by configure in the usual way. If it's missing,
new fonts cannot be generated.
The font body height is now explicitly stored in the font
structure. This is the definition that would be used for manual
typesetting (i.e. the line spacing). This is used for calculating
the heights of strings.
The window title header has also been increased by 3 pixels from a
hard-coded 18 to (font_height + 5), which now equates to 21 pixels
with the sans-10.fv1 font.
This may throw a warning with clang-15+ when devel logs are disabled
Fixes
../../../xrdp-0.9.19/sesman/chansrv/chansrv.c:198:9: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
To implement a scalable login screen, we need to be able to ascertain
the DPI of the connected primary monitor.
At present, in a multi-monitor situation, this information is available in
the struct display_size_description, which can be searched for the primary
monitor. This is only the case however if the Display Control Channel
Extension is in use ([MS-RDPEDISP]), and a DISPLAYCONTROL_MONITOR_LAYOUT
has been received.
This PR retrieves physical monitor size information from the following
two additional places.
1) The TS_UD_CS_CORE PDU. Physical size information is optionally
included in this PDU for single-screen configurations.
2) The TS_UD_CS_MONITOR_EX PDU. This includes physical size
information for multiple-screen configurations.
- Fixes MSTSC resizing (with RFX as well).
- Queue system so that resizes are processed when XRDP and the X server
are ready, not immediately.
- Deletes and recreates the encoder (RFX fix)
- Introduces a dynamic_monitor_description struct that is used for the
queue system.
- Fix some lines previously introduced by the original resizing code to
be 80 chars long, as is the standard for XRDP.
While this feature is part of other branches for testing EGFX
integration, it somehow never made it into devel. This should fix
https://github.com/neutrinolabs/xrdp/issues/1928, for real this time!
The RFX compression mode requires an encoder. When you resize RFX, you
have to recreate the encoder.
This will fix it as well: https://github.com/neutrinolabs/xrdp/pull/2175,
however, that PR is bigger and more complex and may take longer.
Made session allocation policies more readable and maintainable.
The 'C' policy which was confusing before has been replaced with the
'Separate' keyword. This is a public interface change, but is unlikely
to affect many users.
The logging in session_get_bydata() is substantially improved, making
it far easier to spot why sessions are getting matched or not matched.