You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by "stephzero1 (via GitHub)" <gi...@apache.org> on 2026/06/26 09:54:00 UTC

[PR] GUACAMOLE-1852: Send a desktop scale factor to the RDP server. [guacamole-server]

stephzero1 opened a new pull request, #682:
URL: https://github.com/apache/guacamole-server/pull/682

   Add a new "desktop-scale-factor" RDP parameter (percentage, 100-500; 0 disables). When set, the value is sent to the server as the [MS-RDPBCGR] desktopScaleFactor, paired with a protocol-valid deviceScaleFactor (100/140/180, as required by the spec), so the remote Windows session scales its own UI. This makes it possible to request a device-pixel (high-resolution) framebuffer that stays sharp while keeping UI and text at a comfortable size. The same factor is included in the [MS-RDPEDISP] DISPLAYCONTROL_MONITOR_LAYOUT so it is preserved across dynamic display resizes. Out-of-range values are clamped; when the parameter is omitted the previous behavior is unchanged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GUACAMOLE-1852: Send a desktop scale factor to the RDP server. [guacamole-server]

Posted by "necouchman (via GitHub) via dev" <de...@guacamole.apache.org>.
necouchman commented on code in PR #682:
URL: https://github.com/apache/guacamole-server/pull/682#discussion_r4448650699


##########
src/protocols/rdp/settings.c:
##########
@@ -1544,6 +1595,27 @@ int guac_rdp_get_depth(freerdp* rdp) {
 #endif
 }
 
+int guac_rdp_get_device_scale_factor(int desktop_scale_factor) {
+
+    /*
+     * Per [MS-RDPBCGR] and [MS-RDPEDISP], the device scale factor MUST be one
+     * of exactly 100, 140, or 180 percent. Any other value causes both the
+     * device scale factor AND the accompanying desktop scale factor to be
+     * ignored by the server, so we always map to one of these three values.
+     * The thresholds mirror the behavior of native RDP clients (mstsc /
+     * FreeRDP): scales below 120% use 100, 120%-160% use 140, and anything
+     * higher uses 180.
+     */
+    if (desktop_scale_factor < 120)
+        return 100;
+
+    if (desktop_scale_factor <= 160)
+        return 140;
+
+    return 180;
+
+}
+

Review Comment:
   A couple of questions on this...
   * Is there a reason we're automatically determining the device scale factor from the desktop scale factor? Is automatically determining it preferable to allowing the connection to specify both?
   * I'm not familiar with this aspect of RDP, so I'm not sure if the logic you have above is driven by the protocol, generally accepted in RDP client implementations, or just what you've found that works? Why should a desktop scale factor, for example, 350%, be coupled with a device scale factor of 180%?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GUACAMOLE-1852: Send a desktop scale factor to the RDP server. [guacamole-server]

Posted by "stephzero1 (via GitHub)" <gi...@apache.org>.
stephzero1 commented on PR #682:
URL: https://github.com/apache/guacamole-server/pull/682#issuecomment-5567838415

   > Just used this patch on my guac server to test, and it is such a great improvement.
   > 
   > Hope this gets merged in soon.
   
   Thanks for the "bump";
   the patch was very straightforward (thanks to AI, of course).
   
   The improvement is also pretty painless and essentially just an enhancement (it’s optional—you can use it if you want, or otherwise it defaults to the original behavior).
   
   To me, integrating it is a no-brainer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GUACAMOLE-1852: Send a desktop scale factor to the RDP server. [guacamole-server]

Posted by "stephzero1 (via GitHub)" <gi...@apache.org>.
stephzero1 commented on PR #682:
URL: https://github.com/apache/guacamole-server/pull/682#issuecomment-4808517319

   The difference between before:
   <img width="1016" height="786" alt="image" src="https://github.com/user-attachments/assets/e1382e35-bfd6-4dee-a9e4-bf51d55ae52b" />
   and after:
   <img width="1016" height="786" alt="image" src="https://github.com/user-attachments/assets/dbb498a1-682e-476c-886b-3f71ba7da00f" />
   
   on my setup: 42" 4k display with 125% scale factor
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GUACAMOLE-1852: Send a desktop scale factor to the RDP server. [guacamole-server]

Posted by "m0pus (via GitHub)" <gi...@apache.org>.
m0pus commented on PR #682:
URL: https://github.com/apache/guacamole-server/pull/682#issuecomment-5564430228

   Just used this patch on my guac server to test, and it is such a great improvement.
   
   Hope this gets merged in soon.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org