xrdp
xrdp copied to clipboard
Support for HiDPI
I use an Thinkpad X1 with 200% DPI. when I connect to xrdp, remote X server's dpi is 96. but when I connect to windows rdp, system will process dpi to 200% auto.
I think it depends on the WM.
but when I use Thinkpad X1 to connect xrdp
$ xdpyinfo | grep resolution
resolution: 96x96 dots per inchs
It seem like incorrect dpi was reported by virtual screen
What's your backend? The issue can be addressed with xorgxrdp but can't with VNC.
xorgxrdp
okay cool
@metalefty I have a branch dpi for support monitor info in xrdp and xorgxrdp. but there is some trouble when processing scaling for xorg server. do you have any idea in this?
static RRTransformPtr
rdpGetTransform(uint32_t scale, int width, int height) {
double d_scale;
XFixed f_scale;
if (scale == 0 || scale == 100) return NULL;
d_scale = (double)scale / 100;
f_scale = XDoubleToFixed(d_scale);
RRTransformPtr transform = malloc(sizeof(RRTransformRec));
RRTransformInit(transform);
pixman_transform_init_scale(&transform->transform, f_scale, f_scale);
// PictFilterPtr filter = malloc(sizeof(PictFilterRec));
// filter->name = PictureGetFilterName(PictFilterBest);
// filter->ValidateParams = NULL;
// filter->id = PictFilterBest;
// filter->height = height;
// filter->width = width;
// RRTransformSetFilter(transform, filter, &f_scale, 0, width, height);
return transform;
}
is filter necessary? and how make transform work properly?
by the way, KDE/plasma have also a bit problem with HiDPI with TV's(WebOS) with/without kscreen2, have make a bugreport under bugs.kde.org https://bugs.kde.org/show_bug.cgi?id=425111 just as info and hint ...
I think we need to call x86SetDpi
here https://github.com/neutrinolabs/xorgxrdp/blob/a4ce59b46867e61ffc7bb630824d764916c78832/module/rdpClientCon.c#L749
We need to compute the scale based on what the client sends us through the monitor description. I'm not sure how to go from, say, 200% scale to a given DPI. Right now this is set to 0 here: https://github.com/neutrinolabs/xorgxrdp/blob/a4ce59b46867e61ffc7bb630824d764916c78832/xrdpdev/xrdpdev.c#L244
Relevant PDU is here: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpedisp/ea2de591-9203-42cd-9908-be7a55237d1c
We're interested specifically in piping through DesktopScaleFactor
i use mostly 125 or 130 DPI in KDE over sddm.conf
uhddpi=130
sddmconf_update(){
echo -en "\n[Wayland]\n EnableHiDPI=true \n ServerArguments=-nolisten tcp -dpi $uhddpi \n \n[X11]\n EnableHiDPI=true\n ServerArguments=-nolisten tcp -dpi $uhddpi \n " >>/etc/sddm.conf
}
best