Changeset View
Changeset View
Standalone View
Standalone View
rdp/rdpview.cpp
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | 113 | { | |||
---|---|---|---|---|---|
155 | xfreeRDPVersionCheck->waitForFinished(); | 155 | xfreeRDPVersionCheck->waitForFinished(); | ||
156 | QString versionOutput = QString::fromUtf8(xfreeRDPVersionCheck->readAllStandardOutput().constData()); | 156 | QString versionOutput = QString::fromUtf8(xfreeRDPVersionCheck->readAllStandardOutput().constData()); | ||
157 | xfreeRDPVersionCheck->deleteLater(); | 157 | xfreeRDPVersionCheck->deleteLater(); | ||
158 | 158 | | |||
159 | m_process = new QProcess(m_container); | 159 | m_process = new QProcess(m_container); | ||
160 | 160 | | |||
161 | QStringList arguments; | 161 | QStringList arguments; | ||
162 | 162 | | |||
163 | int width, height; | 163 | QSize size; | ||
164 | const auto dpr = devicePixelRatioF(); | ||||
164 | if (m_hostPreferences->width() > 0) { | 165 | if (m_hostPreferences->width() > 0) { | ||
165 | width = m_hostPreferences->width(); | 166 | size = QSize(m_hostPreferences->width(), m_hostPreferences->height()); | ||
166 | height = m_hostPreferences->height(); | | |||
167 | } else { | 167 | } else { | ||
168 | width = this->parentWidget()->size().width(); | 168 | size = this->parentWidget()->size() * dpr; | ||
169 | height = this->parentWidget()->size().height(); | | |||
170 | } | 169 | } | ||
171 | m_containerWidget->setFixedWidth(width); | 170 | m_containerWidget->setFixedSize(size / dpr); | ||
172 | m_containerWidget->setFixedHeight(height); | 171 | setMaximumSize(size / dpr); | ||
murrant: When the size is explicitly set and dpr != 1, this does not seem to have the intended effect. | |||||
volkov: 1. The user sets the size in device pixels, while the sizes of widgets are in device… | |||||
173 | setMaximumSize(width, height); | | |||
174 | if (versionOutput.contains(QLatin1String(" 1.0"))) { | 172 | if (versionOutput.contains(QLatin1String(" 1.0"))) { | ||
175 | qCDebug(KRDC) << "Use FreeRDP 1.0 compatible arguments"; | 173 | qCDebug(KRDC) << "Use FreeRDP 1.0 compatible arguments"; | ||
176 | 174 | | |||
177 | arguments << QStringLiteral("-g") << QString::number(width) + QLatin1Char('x') + QString::number(height); | 175 | arguments << QStringLiteral("-g") << QString::number(size.width()) + QLatin1Char('x') + QString::number(size.height()); | ||
178 | 176 | | |||
179 | arguments << QStringLiteral("-k") << keymapToXfreerdp(m_hostPreferences->keyboardLayout()); | 177 | arguments << QStringLiteral("-k") << keymapToXfreerdp(m_hostPreferences->keyboardLayout()); | ||
180 | 178 | | |||
181 | if (!m_url.userName().isEmpty()) { | 179 | if (!m_url.userName().isEmpty()) { | ||
182 | // if username contains a domain, it needs to be set with another parameter | 180 | // if username contains a domain, it needs to be set with another parameter | ||
183 | if (m_url.userName().contains(QLatin1Char('\\'))) { | 181 | if (m_url.userName().contains(QLatin1Char('\\'))) { | ||
184 | const QStringList splittedName = m_url.userName().split(QLatin1Char('\\')); | 182 | const QStringList splittedName = m_url.userName().split(QLatin1Char('\\')); | ||
185 | arguments << QStringLiteral("-d") << splittedName.at(0); | 183 | arguments << QStringLiteral("-d") << splittedName.at(0); | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | |||||
262 | if (!m_url.password().isNull()) | 260 | if (!m_url.password().isNull()) | ||
263 | arguments << QStringLiteral("-p") << m_url.password(); | 261 | arguments << QStringLiteral("-p") << m_url.password(); | ||
264 | arguments << m_host; | 262 | arguments << m_host; | ||
265 | 263 | | |||
266 | } else { | 264 | } else { | ||
267 | qCDebug(KRDC) << "Use FreeRDP 1.1+ compatible arguments"; | 265 | qCDebug(KRDC) << "Use FreeRDP 1.1+ compatible arguments"; | ||
268 | 266 | | |||
269 | arguments << QStringLiteral("-decorations"); | 267 | arguments << QStringLiteral("-decorations"); | ||
270 | arguments << QStringLiteral("/w:") + QString::number(width); | 268 | arguments << QStringLiteral("/w:") + QString::number(size.width()); | ||
271 | arguments << QStringLiteral("/h:") + QString::number(height); | 269 | arguments << QStringLiteral("/h:") + QString::number(size.height()); | ||
272 | 270 | | |||
273 | arguments << QStringLiteral("/kbd:") + keymapToXfreerdp(m_hostPreferences->keyboardLayout()); | 271 | arguments << QStringLiteral("/kbd:") + keymapToXfreerdp(m_hostPreferences->keyboardLayout()); | ||
274 | 272 | | |||
275 | if (!m_url.userName().isEmpty()) { | 273 | if (!m_url.userName().isEmpty()) { | ||
276 | // if username contains a domain, it needs to be set with another parameter | 274 | // if username contains a domain, it needs to be set with another parameter | ||
277 | if (m_url.userName().contains(QLatin1Char('\\'))) { | 275 | if (m_url.userName().contains(QLatin1Char('\\'))) { | ||
278 | const QStringList splittedName = m_url.userName().split(QLatin1Char('\\')); | 276 | const QStringList splittedName = m_url.userName().split(QLatin1Char('\\')); | ||
279 | arguments << QStringLiteral("/d:") + splittedName.at(0); | 277 | arguments << QStringLiteral("/d:") + splittedName.at(0); | ||
▲ Show 20 Lines • Show All 412 Lines • Show Last 20 Lines |
When the size is explicitly set and dpr != 1, this does not seem to have the intended effect.
The code that resizes the window on tab change does not do the same thing, it just sets the size without transformation.