Internal
Public Access
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f8fa3272b | ||
|
|
96c8403f3b | ||
|
|
3e621219f1 | ||
|
|
e0969041a7 | ||
|
|
c4a62e8fb6 | ||
|
|
9a22597d4e | ||
|
|
e90e9b5abf | ||
|
|
92d8b62820 | ||
|
|
7ee930693e |
+2
-1
@@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
|
||||
project(OrbitHub VERSION 2026.9.8.3 LANGUAGES CXX)
|
||||
project(OrbitHub VERSION 2026.9.14.2 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
@@ -134,6 +134,7 @@ add_executable(orbithub WIN32 MACOSX_BUNDLE ${ORBITHUB_SOURCES})
|
||||
|
||||
target_link_libraries(orbithub PRIVATE Qt6::Widgets Qt6::Sql)
|
||||
target_link_libraries(orbithub PRIVATE KodoTerm::KodoTerm)
|
||||
target_compile_definitions(orbithub PRIVATE ORBITHUB_VERSION_STRING="${PROJECT_VERSION}")
|
||||
if(TARGET freerdp AND TARGET winpr)
|
||||
target_compile_definitions(orbithub PRIVATE ORBITHUB_HAS_FREERDP)
|
||||
target_include_directories(orbithub PRIVATE
|
||||
|
||||
@@ -16,14 +16,14 @@ OrbitHub is in active development.
|
||||
- Milestones completed: M0-M5, and M7-M9
|
||||
- Current milestone: Milestone 10 (v1.0 Stabilization)
|
||||
- Deferred milestone: Milestone 6 (VNC Fully Working)
|
||||
- Latest checkpoint tag: `v2026.9.8.3`
|
||||
- Latest checkpoint tag: `v2026.9.14.2`
|
||||
- VNC implementation milestone (M6) is currently deferred
|
||||
|
||||
Progress and milestone details:
|
||||
- [docs/PROGRESS.md](docs/PROGRESS.md)
|
||||
|
||||
Latest release (installers for Windows, Linux, and macOS):
|
||||
- [v2026.9.8.3](https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.8.3)
|
||||
- [v2026.9.14.2](https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.14.2)
|
||||
|
||||
User Guide:
|
||||
- [docs/USER_GUIDE.md](docs/USER_GUIDE.md) (also available as a PDF attached to each release, and in-app via `Help -> User Guide`)
|
||||
|
||||
@@ -200,6 +200,8 @@ Git:
|
||||
- Release: [v2026.9.8](https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.8) (`v2026.9.8` tag, installers for Windows/Linux/macOS)
|
||||
- Release: [v2026.9.8.2](https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.8.2) — same-day patch fixing RDP TLS certificate verification (was fully disabled) and preparing Flatpak packaging for Flathub submission
|
||||
- Release: [v2026.9.8.3](https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.8.3) — same-day patch adding an in-app User Guide and standalone User Guide PDF
|
||||
- Release: [v2026.9.14](https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.14) — fixes distorted RDP text on HiDPI monitors and reduces RDP resize-related display glitches
|
||||
- Release: [v2026.9.14.2](https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.14.2) — same-day patch fixing RDP display corruption (missing/misplaced taskbar) after resizing the session window (the client never resized its own display buffer for channel-driven RDP resizes)
|
||||
|
||||
## Milestone 10 - v1.0 Stabilization
|
||||
|
||||
|
||||
@@ -19,5 +19,5 @@ modules:
|
||||
sources:
|
||||
- type: git
|
||||
url: https://git.darksingularity.org/DarkSingularity/orbithub.git
|
||||
tag: v2026.9.8.2
|
||||
commit: 4c649f727fb794f4b5afdc3186e545e20ce2f138
|
||||
tag: v2026.9.14.2
|
||||
commit: 3e621219f12e9168b152140d927d672f7877b379
|
||||
|
||||
@@ -34,6 +34,18 @@
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<releases>
|
||||
<release version="2026.9.14.2" date="2026-09-14">
|
||||
<url>https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.14.2</url>
|
||||
<description>
|
||||
<p>Fixes RDP display corruption (missing/misplaced taskbar, stale composited content) after resizing the session window.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2026.9.14" date="2026-09-14">
|
||||
<url>https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.14</url>
|
||||
<description>
|
||||
<p>Fixes distorted RDP text on HiDPI monitors, and reduces RDP resize-related display glitches.</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="2026.9.8.3" date="2026-09-08">
|
||||
<url>https://git.darksingularity.org/DarkSingularity/orbithub/releases/tag/v2026.9.8.3</url>
|
||||
<description>
|
||||
|
||||
+27
-2
@@ -8,6 +8,31 @@
|
||||
#include <QTextBrowser>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace {
|
||||
// palette(mid) is meant for 3D bevel/shadow decoration, not text — it has
|
||||
// poor contrast against the window background in dark themes (barely
|
||||
// legible). Blend the widget's actual text and window colors instead, so
|
||||
// the result is reliably readable — de-emphasized relative to full-strength
|
||||
// text, but never low-contrast — in either a light or dark theme.
|
||||
QColor mutedTextColor(const QWidget* widget)
|
||||
{
|
||||
const QPalette pal = widget->palette();
|
||||
const QColor text = pal.color(QPalette::WindowText);
|
||||
const QColor background = pal.color(QPalette::Window);
|
||||
constexpr qreal kTextWeight = 0.65;
|
||||
|
||||
auto blend = [kTextWeight](int textChannel, int backgroundChannel) {
|
||||
return qBound(0,
|
||||
qRound(textChannel * kTextWeight + backgroundChannel * (1.0 - kTextWeight)),
|
||||
255);
|
||||
};
|
||||
|
||||
return QColor(blend(text.red(), background.red()),
|
||||
blend(text.green(), background.green()),
|
||||
blend(text.blue(), background.blue()));
|
||||
}
|
||||
}
|
||||
|
||||
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
||||
{
|
||||
setWindowTitle(QStringLiteral("About OrbitHub"));
|
||||
@@ -34,7 +59,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
||||
QStringLiteral("Unified remote session manager for SSH, RDP, and VNC workflows."),
|
||||
this);
|
||||
subtitle->setWordWrap(true);
|
||||
subtitle->setStyleSheet(QStringLiteral("color: palette(mid);"));
|
||||
subtitle->setStyleSheet(QStringLiteral("color: %1;").arg(mutedTextColor(this).name()));
|
||||
|
||||
const QString version = QCoreApplication::applicationVersion().trimmed().isEmpty()
|
||||
? QStringLiteral("Development build")
|
||||
@@ -42,7 +67,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
||||
auto* buildLine = new QLabel(
|
||||
QStringLiteral("Version: %1 | Qt runtime linked dynamically").arg(version),
|
||||
this);
|
||||
buildLine->setStyleSheet(QStringLiteral("color: palette(mid);"));
|
||||
buildLine->setStyleSheet(QStringLiteral("color: %1;").arg(mutedTextColor(this).name()));
|
||||
|
||||
titleColumn->addWidget(title);
|
||||
titleColumn->addWidget(subtitle);
|
||||
|
||||
@@ -10,6 +10,9 @@ int main(int argc, char* argv[])
|
||||
QApplication app(argc, argv);
|
||||
app.setOrganizationName(QStringLiteral("FireBugIT"));
|
||||
app.setApplicationName(QStringLiteral("OrbitHub"));
|
||||
#ifdef ORBITHUB_VERSION_STRING
|
||||
app.setApplicationVersion(QStringLiteral(ORBITHUB_VERSION_STRING));
|
||||
#endif
|
||||
app.setWindowIcon(createOrbitHubAppIcon());
|
||||
|
||||
SessionWindow window;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "rdp_display_widget.h"
|
||||
|
||||
#include <QCursor>
|
||||
#include <QEvent>
|
||||
#include <QKeyEvent>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
@@ -15,20 +16,38 @@ QSize sanitizeSize(const QSize& size)
|
||||
{
|
||||
return QSize(qMax(1, size.width()), qMax(1, size.height()));
|
||||
}
|
||||
|
||||
qreal sanitizeDevicePixelRatio(qreal ratio)
|
||||
{
|
||||
if (!(ratio > 0.0)) {
|
||||
return 1.0;
|
||||
}
|
||||
return qBound(1.0, ratio, 4.0);
|
||||
}
|
||||
|
||||
// Windows' virtual-display driver can visibly glitch (stale composited
|
||||
// content left on screen) when asked to change resolution repeatedly in
|
||||
// quick succession, which naturally happens as the window's layout settles
|
||||
// right after creation/connect. Coalescing bursts of resize events into one
|
||||
// request avoids triggering that.
|
||||
constexpr int kResizeDebounceMs = 150;
|
||||
}
|
||||
|
||||
RdpDisplayWidget::RdpDisplayWidget(QWidget* parent)
|
||||
: QWidget(parent), m_remoteSize(1280, 720), m_cursorMode(CursorMode::Default)
|
||||
: QWidget(parent),
|
||||
m_remoteSize(1280, 720),
|
||||
m_cursorMode(CursorMode::Default),
|
||||
m_resizeDebounceTimer(new QTimer(this))
|
||||
{
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setMouseTracking(true);
|
||||
setAutoFillBackground(false);
|
||||
setMinimumSize(320, 200);
|
||||
|
||||
QTimer::singleShot(0, this, [this]() {
|
||||
const QSize size = sanitizeSize(this->size());
|
||||
emit viewportSizeChanged(size.width(), size.height());
|
||||
});
|
||||
m_resizeDebounceTimer->setSingleShot(true);
|
||||
connect(m_resizeDebounceTimer, &QTimer::timeout, this, &RdpDisplayWidget::emitViewportGeometry);
|
||||
|
||||
scheduleViewportGeometryEmit();
|
||||
}
|
||||
|
||||
void RdpDisplayWidget::setFrame(const QImage& frame)
|
||||
@@ -54,6 +73,13 @@ void RdpDisplayWidget::setRemoteDesktopSize(int width, int height)
|
||||
}
|
||||
|
||||
m_remoteSize = nextSize;
|
||||
// The next actual frame (via setFrame) arrives asynchronously and isn't
|
||||
// guaranteed to be sized to match yet. Drawing the old frame stretched
|
||||
// to a renderRect() computed from the new m_remoteSize would scale it
|
||||
// by the wrong factor for the transition window, producing visibly
|
||||
// distorted/duplicated-looking content. Clear it and show the existing
|
||||
// "waiting for frame" placeholder until a correctly-sized frame lands.
|
||||
m_frame = QImage();
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -140,11 +166,39 @@ void RdpDisplayWidget::paintEvent(QPaintEvent* event)
|
||||
void RdpDisplayWidget::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
const QSize size = sanitizeSize(event->size());
|
||||
emit viewportSizeChanged(size.width(), size.height());
|
||||
scheduleViewportGeometryEmit();
|
||||
applyCursor();
|
||||
}
|
||||
|
||||
bool RdpDisplayWidget::event(QEvent* event)
|
||||
{
|
||||
// Fires when this widget's effective screen changes (e.g. dragged to a
|
||||
// different monitor), which is what changes devicePixelRatio(). Newer
|
||||
// Qt versions add a more specific QEvent::DevicePixelRatioChange, but
|
||||
// this project's Qt 6.2 floor doesn't have it.
|
||||
if (event->type() == QEvent::ScreenChangeInternal) {
|
||||
scheduleViewportGeometryEmit();
|
||||
}
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
||||
void RdpDisplayWidget::scheduleViewportGeometryEmit()
|
||||
{
|
||||
// Restarting an already-running single-shot timer resets its countdown,
|
||||
// so a burst of resize events collapses into one emission after things
|
||||
// settle, rather than one request per event.
|
||||
m_resizeDebounceTimer->start(kResizeDebounceMs);
|
||||
}
|
||||
|
||||
void RdpDisplayWidget::emitViewportGeometry()
|
||||
{
|
||||
const QSize logicalSize = sanitizeSize(this->size());
|
||||
const qreal ratio = sanitizeDevicePixelRatio(this->devicePixelRatioF());
|
||||
const QSize physicalSize(qRound(logicalSize.width() * ratio), qRound(logicalSize.height() * ratio));
|
||||
emit viewportSizeChanged(physicalSize.width(), physicalSize.height());
|
||||
emit displayScaleChanged(ratio);
|
||||
}
|
||||
|
||||
void RdpDisplayWidget::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
if (event == nullptr) {
|
||||
|
||||
@@ -8,6 +8,7 @@ class QKeyEvent;
|
||||
class QMouseEvent;
|
||||
class QPaintEvent;
|
||||
class QResizeEvent;
|
||||
class QTimer;
|
||||
class QWheelEvent;
|
||||
|
||||
class RdpDisplayWidget : public QWidget
|
||||
@@ -30,10 +31,12 @@ signals:
|
||||
void mouseButtonInput(int x, int y, int button, bool pressed);
|
||||
void mouseWheelInput(int x, int y, int deltaX, int deltaY);
|
||||
void viewportSizeChanged(int width, int height);
|
||||
void displayScaleChanged(qreal devicePixelRatio);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
bool event(QEvent* event) override;
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void keyReleaseEvent(QKeyEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
@@ -54,11 +57,14 @@ private:
|
||||
QImage m_cursorImage;
|
||||
QPoint m_cursorHotspot;
|
||||
CursorMode m_cursorMode;
|
||||
QTimer* m_resizeDebounceTimer;
|
||||
|
||||
QRectF renderRect() const;
|
||||
QPoint mapToRemote(const QPointF& pos) const;
|
||||
QSize effectiveRemoteSize() const;
|
||||
void applyCursor();
|
||||
void emitViewportGeometry();
|
||||
void scheduleViewportGeometryEmit();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+113
-5
@@ -104,6 +104,22 @@ QString normalizedRdpSecurityMode(const QString& value)
|
||||
return QStringLiteral("Negotiate");
|
||||
}
|
||||
|
||||
// MS-RDPEDISP restricts DesktopScaleFactor/DeviceScaleFactor to exactly
|
||||
// these three values; FreeRDP's own reference client enforces the same
|
||||
// set (client/common/cmdline.c, parse_scale_options). Anything else is
|
||||
// silently ignored by the server, so map the real, continuous
|
||||
// devicePixelRatio down to the nearest one.
|
||||
UINT32 nearestFreeRdpScaleValue(qreal ratio)
|
||||
{
|
||||
if (ratio <= 1.2) {
|
||||
return 100;
|
||||
}
|
||||
if (ratio <= 1.6) {
|
||||
return 140;
|
||||
}
|
||||
return 180;
|
||||
}
|
||||
|
||||
QString normalizedRdpPerformanceProfile(const QString& value)
|
||||
{
|
||||
const QString profile = value.trimmed();
|
||||
@@ -1304,6 +1320,7 @@ RdpSessionBackend::RdpSessionBackend(const Profile& profile, QObject* parent)
|
||||
m_userInitiatedDisconnect(false),
|
||||
m_requestedDesktopWidth(kDefaultDesktopWidth),
|
||||
m_requestedDesktopHeight(kDefaultDesktopHeight),
|
||||
m_devicePixelRatio(1.0),
|
||||
m_workerRunning(false),
|
||||
m_stopRequested(false),
|
||||
m_instance(nullptr),
|
||||
@@ -1312,6 +1329,7 @@ RdpSessionBackend::RdpSessionBackend(const Profile& profile, QObject* parent)
|
||||
m_resizeFailureLogged(false),
|
||||
m_lastResizeWidth(0),
|
||||
m_lastResizeHeight(0),
|
||||
m_lastResizeScale(0),
|
||||
m_cliprdrContext(nullptr)
|
||||
{
|
||||
}
|
||||
@@ -1403,6 +1421,28 @@ void RdpSessionBackend::updateTerminalSize(int columns, int rows)
|
||||
enqueueInputEvent(event);
|
||||
}
|
||||
|
||||
void RdpSessionBackend::updateDisplayScale(qreal devicePixelRatio)
|
||||
{
|
||||
const qreal clamped = qBound(1.0, devicePixelRatio, 4.0);
|
||||
m_devicePixelRatio.store(clamped);
|
||||
|
||||
if (!m_workerRunning.load()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Reuses the resize input-event path so the worker thread (which owns
|
||||
// m_instance) picks this up safely; processInputEvents' dedup check
|
||||
// also compares the quantized scale value, so this correctly triggers
|
||||
// a fresh SendMonitorLayout even when width/height haven't changed
|
||||
// (e.g. the window moved to a different-DPI monitor at the same
|
||||
// logical size).
|
||||
InputEvent event;
|
||||
event.type = InputEventType::Resize;
|
||||
event.width = sanitizeDesktopWidth(m_requestedDesktopWidth.load());
|
||||
event.height = sanitizeDesktopHeight(m_requestedDesktopHeight.load());
|
||||
enqueueInputEvent(event);
|
||||
}
|
||||
|
||||
void RdpSessionBackend::sendKeyEvent(int key,
|
||||
quint32 nativeScanCode,
|
||||
const QString& text,
|
||||
@@ -1637,9 +1677,29 @@ void RdpSessionBackend::workerMain()
|
||||
const QString performanceProfile = normalizedRdpPerformanceProfile(p.rdpPerformanceProfile);
|
||||
freerdp_settings_set_bool(settings, FreeRDP_SupportDisplayControl, TRUE);
|
||||
freerdp_settings_set_bool(settings, FreeRDP_DynamicResolutionUpdate, TRUE);
|
||||
// Lets us actively request a full-screen repaint after a resize (see
|
||||
// sendDisplayResize) — some RDP hosts (particularly VMs using a
|
||||
// synthetic/virtual display driver) occasionally fail to fully redraw
|
||||
// their own desktop after a resolution change; requesting a refresh
|
||||
// forces them to resend everything rather than leaving stale content.
|
||||
freerdp_settings_set_bool(settings, FreeRDP_RefreshRect, TRUE);
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, static_cast<UINT32>(desktopWidth));
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, static_cast<UINT32>(desktopHeight));
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_ColorDepth, 32);
|
||||
// Tell the remote session the real display scale so it renders its own
|
||||
// UI/ClearType text natively at that size, instead of assuming 96 DPI
|
||||
// and having the result stretched (and ClearType's subpixel hinting
|
||||
// distorted) by client-side scaling. The override flags are required —
|
||||
// without them FreeRDP ignores the scale factor values entirely.
|
||||
{
|
||||
const UINT32 scaleValue = nearestFreeRdpScaleValue(m_devicePixelRatio.load());
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_DesktopScaleFactor, scaleValue);
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_DeviceScaleFactor, scaleValue);
|
||||
freerdp_settings_set_uint64(settings,
|
||||
FreeRDP_MonitorOverrideFlags,
|
||||
FREERDP_MONITOR_OVERRIDE_DESKTOP_SCALE
|
||||
| FREERDP_MONITOR_OVERRIDE_DEVICE_SCALE);
|
||||
}
|
||||
freerdp_settings_set_bool(settings, FreeRDP_AuthenticationOnly, FALSE);
|
||||
freerdp_settings_set_bool(settings, FreeRDP_AutoLogonEnabled, TRUE);
|
||||
if (!applyRdpSecurityMode(settings, securityMode)) {
|
||||
@@ -1831,9 +1891,14 @@ bool RdpSessionBackend::sendDisplayResize(rdp_freerdp* instance, int width, int
|
||||
return false;
|
||||
}
|
||||
|
||||
const qreal ratio = m_devicePixelRatio.load();
|
||||
const UINT32 scaleValue = nearestFreeRdpScaleValue(ratio);
|
||||
|
||||
rdpSettings* settings = instance->context->settings;
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, static_cast<UINT32>(width));
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, static_cast<UINT32>(height));
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_DesktopScaleFactor, scaleValue);
|
||||
freerdp_settings_set_uint32(settings, FreeRDP_DeviceScaleFactor, scaleValue);
|
||||
|
||||
DispClientContext* dispContext = nullptr;
|
||||
bool displayControlReady = false;
|
||||
@@ -1851,17 +1916,58 @@ bool RdpSessionBackend::sendDisplayResize(rdp_freerdp* instance, int width, int
|
||||
layout.Width = static_cast<UINT32>(width);
|
||||
layout.Height = static_cast<UINT32>(height);
|
||||
layout.Orientation = ORIENTATION_LANDSCAPE;
|
||||
layout.DesktopScaleFactor = freerdp_settings_get_uint32(settings, FreeRDP_DesktopScaleFactor);
|
||||
layout.DeviceScaleFactor = freerdp_settings_get_uint32(settings, FreeRDP_DeviceScaleFactor);
|
||||
layout.DesktopScaleFactor = scaleValue;
|
||||
layout.DeviceScaleFactor = scaleValue;
|
||||
// Physical size in mm must reflect the real DPI (96 * ratio), not
|
||||
// the plain baseline, so it stays consistent with the scale factor
|
||||
// above rather than implying a standard-DPI display of this size.
|
||||
const double effectiveDpi = kDefaultDpi * ratio;
|
||||
layout.PhysicalWidth = static_cast<UINT32>(
|
||||
std::lround((static_cast<double>(width) / kDefaultDpi) * kMillimetersPerInch));
|
||||
std::lround((static_cast<double>(width) / effectiveDpi) * kMillimetersPerInch));
|
||||
layout.PhysicalHeight = static_cast<UINT32>(
|
||||
std::lround((static_cast<double>(height) / kDefaultDpi) * kMillimetersPerInch));
|
||||
std::lround((static_cast<double>(height) / effectiveDpi) * kMillimetersPerInch));
|
||||
|
||||
const UINT rc = dispContext->SendMonitorLayout(dispContext, 1, &layout);
|
||||
if (rc == CHANNEL_RC_OK) {
|
||||
m_lastResizeWidth = width;
|
||||
m_lastResizeHeight = height;
|
||||
m_lastResizeScale = static_cast<int>(scaleValue);
|
||||
|
||||
// The Display Control channel (MS-RDPEDISP) has no server
|
||||
// acknowledgment PDU, and real hosts apply the new resolution
|
||||
// without a Deactivation-Reactivation sequence — so
|
||||
// update->DesktopResize (which only fires for that sequence, or
|
||||
// for the GFX/Progressive pipeline we don't use) never runs for
|
||||
// a channel-driven resize. Without a matching gdi_resize() call,
|
||||
// gdi->width/height stay at the old size, and FreeRDP's own
|
||||
// surface-bits handling (intersect_rect in gdi.c) then silently
|
||||
// *drops* any update reaching outside those stale bounds —
|
||||
// which is what produced the missing/misplaced taskbar and
|
||||
// stale composited-looking content: this call is the fix, not
|
||||
// just a best-effort nudge.
|
||||
if (instance->context->gdi != nullptr
|
||||
&& gdi_resize(instance->context->gdi, static_cast<UINT32>(width),
|
||||
static_cast<UINT32>(height))) {
|
||||
emit remoteDesktopSizeChanged(width, height);
|
||||
} else if (instance->context->gdi != nullptr) {
|
||||
emit eventLogged(QStringLiteral(
|
||||
"RDP warning: local resize to %1x%2 failed; display may show stale content "
|
||||
"until the next full repaint.")
|
||||
.arg(width)
|
||||
.arg(height));
|
||||
}
|
||||
|
||||
// Best-effort nudge: some hosts don't fully repaint their own
|
||||
// desktop after a resolution change (observed: taskbar missing
|
||||
// until something else forces a redraw). Explicitly asking for
|
||||
// the whole new area to be resent costs little and helps
|
||||
// recover from that when it happens.
|
||||
if (instance->context->update != nullptr
|
||||
&& instance->context->update->RefreshRect != nullptr) {
|
||||
RECTANGLE_16 fullArea = {0, 0, static_cast<UINT16>(qMin(width, 65535)),
|
||||
static_cast<UINT16>(qMin(height, 65535))};
|
||||
instance->context->update->RefreshRect(instance->context, 1, &fullArea);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -2035,7 +2141,9 @@ void RdpSessionBackend::processInputEvents(rdp_freerdp* instance)
|
||||
if (hasResize) {
|
||||
const int width = sanitizeDesktopWidth(resizeWidth);
|
||||
const int height = sanitizeDesktopHeight(resizeHeight);
|
||||
if (width != m_lastResizeWidth || height != m_lastResizeHeight) {
|
||||
const int scaleValue = static_cast<int>(nearestFreeRdpScaleValue(m_devicePixelRatio.load()));
|
||||
if (width != m_lastResizeWidth || height != m_lastResizeHeight
|
||||
|| scaleValue != m_lastResizeScale) {
|
||||
if (sendDisplayResize(instance, width, height)) {
|
||||
if (m_resizeFailureLogged) {
|
||||
emit eventLogged(QStringLiteral("Dynamic RDP resize recovered."));
|
||||
|
||||
@@ -26,6 +26,7 @@ public slots:
|
||||
void sendInput(const QString& input) override;
|
||||
void confirmHostKey(bool trustHost) override;
|
||||
void updateTerminalSize(int columns, int rows) override;
|
||||
void updateDisplayScale(qreal devicePixelRatio) override;
|
||||
void sendKeyEvent(int key,
|
||||
quint32 nativeScanCode,
|
||||
const QString& text,
|
||||
@@ -68,6 +69,7 @@ private:
|
||||
|
||||
std::atomic_int m_requestedDesktopWidth;
|
||||
std::atomic_int m_requestedDesktopHeight;
|
||||
std::atomic<qreal> m_devicePixelRatio;
|
||||
|
||||
std::thread m_worker;
|
||||
std::atomic_bool m_workerRunning;
|
||||
@@ -85,6 +87,7 @@ private:
|
||||
bool m_resizeFailureLogged;
|
||||
int m_lastResizeWidth;
|
||||
int m_lastResizeHeight;
|
||||
int m_lastResizeScale;
|
||||
|
||||
std::mutex m_cliprdrMutex;
|
||||
void* m_cliprdrContext;
|
||||
|
||||
@@ -47,6 +47,10 @@ public slots:
|
||||
virtual void sendInput(const QString& input) = 0;
|
||||
virtual void confirmHostKey(bool trustHost) = 0;
|
||||
virtual void updateTerminalSize(int columns, int rows) = 0;
|
||||
virtual void updateDisplayScale(qreal devicePixelRatio)
|
||||
{
|
||||
Q_UNUSED(devicePixelRatio);
|
||||
}
|
||||
virtual void setClipboardText(const QString& text)
|
||||
{
|
||||
Q_UNUSED(text);
|
||||
|
||||
@@ -176,6 +176,11 @@ SessionTab::SessionTab(const Profile& profile,
|
||||
m_backend,
|
||||
&SessionBackend::updateTerminalSize,
|
||||
Qt::QueuedConnection);
|
||||
connect(this,
|
||||
&SessionTab::requestDisplayScale,
|
||||
m_backend,
|
||||
&SessionBackend::updateDisplayScale,
|
||||
Qt::QueuedConnection);
|
||||
connect(this,
|
||||
&SessionTab::requestKeyEvent,
|
||||
m_backend,
|
||||
@@ -860,6 +865,10 @@ void SessionTab::setupUi()
|
||||
&RdpDisplayWidget::viewportSizeChanged,
|
||||
this,
|
||||
[this](int width, int height) { emit requestTerminalSize(width, height); });
|
||||
connect(m_rdpDisplay,
|
||||
&RdpDisplayWidget::displayScaleChanged,
|
||||
this,
|
||||
[this](qreal ratio) { emit requestDisplayScale(ratio); });
|
||||
connect(m_rdpDisplay,
|
||||
&RdpDisplayWidget::keyInput,
|
||||
this,
|
||||
|
||||
@@ -74,6 +74,7 @@ signals:
|
||||
void requestInput(const QString& input);
|
||||
void requestHostKeyConfirmation(bool trustHost);
|
||||
void requestTerminalSize(int columns, int rows);
|
||||
void requestDisplayScale(qreal devicePixelRatio);
|
||||
void requestKeyEvent(int key,
|
||||
quint32 nativeScanCode,
|
||||
const QString& text,
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
3.23.1-dev0
|
||||
Reference in New Issue
Block a user