Bug 417310 - Incorrect resolution with HiDPI scaling on
Summary: Incorrect resolution with HiDPI scaling on
Status: REPORTED
Alias: None
Product: krdc
Classification: Applications
Component: general (show other bugs)
Version: 19.12
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Urs Wolfer
URL:
Keywords:
: 389754 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-02-08 17:13 UTC by Yichao Yu
Modified: 2021-06-22 19:24 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot showing the issue. (176.36 KB, image/png)
2020-05-24 17:57 UTC, kde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yichao Yu 2020-02-08 17:13:32 UTC
SUMMARY

This issue has come up some time ago, got fixed but is appearing again. There does seem to be some changne WRT scaling in the latest Qt5/KF5 since a few other applications also changed (usually for the better).

STEPS TO REPRODUCE
1. Enable scaling in systemsettings (e.g. 2)
2. Set rdp screen resolution to be "Current KRDC size"

OBSERVED RESULT
The RDP view will be half the size of the window instead of the full size as expected.

This is not limited to this particular setting. Changing the size to be larger than this cause the scroll bar to appear even though it's not needed. I highly suspect this to be the same for other connection backend as well but I cannot test myself...

EXPECTED RESULT
At least the size of the remote display and the size of the window should agree, i.e. when the apparent display size on the screen is smaller than the widget size it fits in, there should be no scrollbar. I can see argument for both using the scaled or unscaled resolution for the remote connection so I think it might be good to add an option for that. (This basically depend on whether the remote side is aware of how to deal with HiDPI). This is of course assuming that the backend actually support this. xfreerdp does seem to have related options...

Personally I prefer having a high resolution remote and I've tested that the following completely incorrect patch works for my setting.

```
diff --git a/rdp/rdpview.cpp b/rdp/rdpview.cpp
index 4adc4cc..925eca0 100644
--- a/rdp/rdpview.cpp
+++ b/rdp/rdpview.cpp
@@ -183,7 +183,7 @@ bool RdpView::start()
     if (versionOutput.contains(QLatin1String(" 1.0"))) {
         qCDebug(KRDC) << "Use FreeRDP 1.0 compatible arguments";

-        arguments << QStringLiteral("-g") << QString::number(width) + QLatin1Char('x') + QString::number(height);
+        arguments << QStringLiteral("-g") << QString::number(width * 2) + QLatin1Char('x') + QString::number(height * 2);

         arguments << QStringLiteral("-k") << keymapToXfreerdp(m_hostPreferences->keyboardLayout());

@@ -276,8 +276,8 @@ bool RdpView::start()
         qCDebug(KRDC) << "Use FreeRDP 1.1+ compatible arguments";

         arguments << QStringLiteral("-decorations");
-        arguments << QStringLiteral("/w:") + QString::number(width);
-        arguments << QStringLiteral("/h:") + QString::number(height);
+        arguments << QStringLiteral("/w:") + QString::number(width * 2);
+        arguments << QStringLiteral("/h:") + QString::number(height * 2);

         arguments << QStringLiteral("/kbd:") + keymapToXfreerdp(m_hostPreferences->keyboardLayout());
```

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ArchLinux latest as of 2/8/2020 (testing enabled)
(available in About System)
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.66.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION
Comment 1 kde 2020-05-24 17:57:07 UTC
Created attachment 128754 [details]
Screenshot showing the issue.
Comment 2 Yichao Yu 2020-05-24 18:19:58 UTC
Note that there is a fix from a year ago waiting for review @ https://phabricator.kde.org/D20790.
Comment 3 kde 2020-05-24 19:48:37 UTC
*** Bug 389754 has been marked as a duplicate of this bug. ***