Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
docs(plan): the UI must match the approved design exactly, and record why it does not
Veyra Goal Agent5f307fc30269
diff --git a/apps/veyra-qml/main.cpp b/apps/veyra-qml/main.cppindex ba49efaf..f6a264c5 100644--- a/apps/veyra-qml/main.cpp+++ b/apps/veyra-qml/main.cpp@@ -20,9 +20,11 @@#include <windows.h>+#include <format>#include <memory>#include "veyra/Log.h"+#include "veyra/RuntimePaths.h"#include "veyra/engine/EngineController.h"#include "veyra/ui/QmlPlayerBridge.h"@@ -72,9 +74,24 @@ void syncVideoGeometry(QQuickWindow* window, QQuickItem* host) {} // namespaceint main(int argc, char** argv) {+ // A log file has to be opened explicitly; without this the QML app produced+ // no diagnostics at all, which made every failure look like a silent exit.+ // Same path and override as the Win32 build, so support instructions do not+ // change between the two front ends.+ wchar_t logOverride[32768]{};+ const auto overrideLength = GetEnvironmentVariableW(L"VEYRA_LOG_FILE", logOverride, 32768);+ auto logPath = overrideLength > 0 && overrideLength < 32768+ ? std::filesystem::path(logOverride)+ : veyra::runtime::logsDirectory() / L"veyra-qml.log";+ if (!veyra::Logger::instance().openFile(logPath.wstring(), true)) {+ logPath = logPath.parent_path() / (L"veyra-qml-" + std::to_wstring(GetCurrentProcessId()) + L".log");+ (void)veyra::Logger::instance().openFile(logPath.wstring(), true);+ }+QGuiApplication app(argc, argv);app.setApplicationName(QStringLiteral("Veyra"));app.setOrganizationName(QStringLiteral("Veyra"));+ veyra::log::info("app", "Veyra QML session started");engine::EngineController controller;@@ -87,6 +104,17 @@ int main(int argc, char** argv) {ui::QmlPlayerBridge bridge(controller);bridge.attachVideoWindow(reinterpret_cast<qulonglong>(g_video));+ // Qt reports QML failures through its own message handler. Routing them to+ // the log is the difference between "it did not load" and why.+ qInstallMessageHandler([](QtMsgType type, const QMessageLogContext&, const QString& message) {+ const std::string utf8 = message.toUtf8().toStdString();+ if (type == QtWarningMsg || type == QtCriticalMsg || type == QtFatalMsg) {+ veyra::log::error("qml", utf8);+ } else {+ veyra::log::info("qml", utf8);+ }+ });+QQmlApplicationEngine engine;engine.addImportPath(QCoreApplication::applicationDirPath() + "/qml");engine.rootContext()->setContextProperty(QStringLiteral("veyra"), &bridge);@@ -109,19 +137,65 @@ int main(int argc, char** argv) {// Reparent the native window under the QML window and keep it in step. The// host item is looked up by objectName so the QML side owns the layout and// this side only follows it.- QObject::connect(window, &QQuickWindow::sceneGraphInitialized, [window, &bridge] {- if (g_video) SetParent(g_video, reinterpret_cast<HWND>(window->winId()));+ // The host item's geometry is followed on a timer rather than through change+ // signals. Signals only fire when a value changes, and the first layout pass+ // can leave the host at its default (0x0) with no change to observe, which+ // is how the engine ended up building a swapchain from a 1x1 window.+ auto* follow = new QTimer(&app);+ QObject::connect(follow, &QTimer::timeout, &app, [window] {+ if (!g_video) return;+ // Report the search itself until it succeeds: "the log is silent" and+ // "the lookup failed" look identical otherwise, and that ambiguity cost+ // a round of guessing already.+ static int ticks = 0;+ ++ticks;+ if (ticks < 3 || ticks % 120 == 0) {+ auto* found = window->findChild<QQuickItem*>(QStringLiteral("videoHost"));+ veyra::log::info("qml", std::format("video host lookup: found={} contentChildren={}",+ found != nullptr,+ window->contentItem() ? window->contentItem()->childItems().size() : -1));+ }+ static bool reparented = false;+ if (!reparented) {+ SetParent(g_video, reinterpret_cast<HWND>(window->winId()));+ reparented = true;+ }if (auto* host = window->findChild<QQuickItem*>(QStringLiteral("videoHost"))) {- auto sync = [window, host] { syncVideoGeometry(window, host); };- QObject::connect(host, &QQuickItem::xChanged, window, sync);- QObject::connect(host, &QQuickItem::yChanged, window, sync);- QObject::connect(host, &QQuickItem::widthChanged, window, sync);- QObject::connect(host, &QQuickItem::heightChanged, window, sync);- sync();- } else {- veyra::log::warn("qml", "no videoHost item: the video window has nowhere to sit");+ // Report the resolved geometry once at each distinct size, so the log+ // says what the video window was actually given.+ static int lastW = -1, lastH = -1;+ const int w = int(host->width()), h = int(host->height());+ if (w != lastW || h != lastH) {+ lastW = w; lastH = h;+ veyra::log::info("qml", std::format("video host geometry {}x{} at {},{}",+ w, h, int(host->x()), int(host->y())));+ }+ syncVideoGeometry(window, host);}});+ follow->start(16);++ // Before every open, place the native window and force the pending layout to+ // be applied so the client size the presenter reads is the real one.+ bridge.setPreOpenHook([window] {+ auto* host = window->findChild<QQuickItem*>(QStringLiteral("videoHost"));+ veyra::log::info("qml", std::format("pre-open: host={} size={}x{} contentChildren={}",+ host != nullptr,+ host ? int(host->width()) : -1,+ host ? int(host->height()) : -1,+ window->contentItem() ? window->contentItem()->childItems().size() : -1));+ if (host) syncVideoGeometry(window, host);+ UpdateWindow(g_video);+ });++ // A file on the command line opens immediately. This exists so playback can+ // be verified end to end by a test rather than by a person clicking around;+ // it is not a user-facing feature.+ const QStringList args = QCoreApplication::arguments();+ if (args.size() > 1) {+ const QString path = args.at(1);+ QTimer::singleShot(600, &bridge, [&bridge, path] { bridge.openPath(path); });+ }const int rc = app.exec();if (g_video) { DestroyWindow(g_video); g_video = nullptr; }diff --git a/docs/UI_MIGRATION_EXECUTION_2026-09-25.md b/docs/UI_MIGRATION_EXECUTION_2026-09-25.mdindex a3303729..9ec98f1e 100644--- a/docs/UI_MIGRATION_EXECUTION_2026-09-25.md+++ b/docs/UI_MIGRATION_EXECUTION_2026-09-25.md@@ -40,6 +40,23 @@## 日志+### S4.1-修正(2026-09-25)用户验收:界面与设计稿偏差很大 —— **S4.1 的"完成"不成立**+用户验收后明确指出:当前前端和当初的网页设计稿**完全不一样,偏差很大**;最终要求**1:1 还原设计稿**。++**这是一次真实的返工,原因在我**:我施工时**没有对照设计稿**,而是凭印象自己设计了六个页面。所以 S4.1 那条"六个页面全部渲染"只证明**代码能跑**,不证明**界面正确**。验收口径要改:能运行 ≠ 还原。++**逐项核对后的真实差距**(设计稿事实来源 `prototypes/ui-redesign-2026-09-25/board.js` 的 `FRAMES` 表)+- 设计稿有 **17 屏**,我只做了 6 页,且**没有一页**与设计稿布局一致。+- **概念性错误**:极简模式设计稿是"**窗口按影片画幅适配**"(`f-min` 的 `aspect: 2.39`,进入时画面从中间展开、窗口高度弹性过渡到影片画幅)。我做成了固定窗口 + 内部留黑边,**方向就错了**。+- 专业页设计稿是 **5 个标签**(画质/补帧/色彩/声音/显示),我只做了一块参数。+- 导出设计稿是"**只从预设里选**",我做成了"选文件 + 开始导出"。+- 缺 4 个对话框(采集卡/PS5/屏幕捕获/字幕音频)、缺补帧页、缺色彩页、缺预设另存与管理、缺切换节点确认弹窗。+- 节点模式的读数(输入/输出/显示 fps/提交 fps/排队/链路总耗时、每节点耗时、底部耗时条)与设计稿不同。++**已经把 1:1 要求写进主方案**:`docs/UI_MIGRATION_MASTER_PLAN_2026-09-25.md` 新增"S4 前置:界面必须 1:1 还原设计稿",含 17 屏对照表、7 条已确认的概念错误、可执行的逐屏截图比对验收方式,以及"17 屏未逐屏对齐前不进入 S5(不删旧界面)"。++**下一步**:按设计稿逐屏重做 QML,从 `Theme` 令牌与组件库开始对齐,然后逐屏还原并用截图比对留证。+### S4.1(2026-09-25)QML 前端可运行(骨架完成)新增可运行的 Qt/QML 前端,**本机实测启动无 QML 警告**,六个页面全部渲染。diff --git a/docs/UI_MIGRATION_MASTER_PLAN_2026-09-25.md b/docs/UI_MIGRATION_MASTER_PLAN_2026-09-25.mdindex 4a940cec..6673c2fe 100644--- a/docs/UI_MIGRATION_MASTER_PLAN_2026-09-25.md+++ b/docs/UI_MIGRATION_MASTER_PLAN_2026-09-25.md@@ -283,6 +283,55 @@ S0 基线 → S1 引擎地基(画面不变)→ S2 引擎新能力(NR 叠出现时停下报告,改用备选方案:Win32 外壳 + 局部 QML 区域,浮层继续用 Win32 分层窗口自绘。+### S4 前置:**界面必须 1:1 还原设计稿**(2026-09-25 用户明确要求)++用户验收后指出:当前 QML 前端与已批准的设计稿偏差很大,最终前端**必须 1:1 还原设计稿的样子**。这条是硬性验收条件,不是风格建议。++**在此之前我犯的错误(记录以免重犯)**:我没有对照设计稿施工,而是凭记忆和印象自己"设计"了六个页面。结果是页面数量不对、结构不对、概念也不对。下面是把设计稿逐项核对后的真实差距。++**设计稿的权威来源**:`prototypes/ui-redesign-2026-09-25/`(用户已批准)。其中 `board.js` 的 `FRAMES` 表是页面清单的唯一事实来源。++**设计稿共有 17 屏,当前实现只有 6 页且无一对应**++| # | 设计稿 frame id | 页面 | 当前状态 |+|---|---|---|---|+| 1 | `f-home` | 首页(Logo 回到这里) | 有,但布局不同 |+| 2 | `f-min` | 极简 · **2.39:1 影片**(窗口按画幅适配) | **概念错误** |+| 3 | `f-min169` | 极简 · 16:9 影片(顶部切换栏已弹出) | 缺 |+| 4 | `f-cap` | 采集卡对话框 | 缺 |+| 5 | `f-ps5` | PS5 串流对话框 | 缺 |+| 6 | `f-scr` | 屏幕捕获对话框 | 缺 |+| 7 | `f-sub` | 字幕设置 | 缺 |+| 8 | `f-aud` | 音频 / 音轨设置 | 缺 |+| 9 | `f-pro` | 专业 · 画质 | 有 1 个标签,设计稿 5 个 |+| 10 | `f-fg` | 专业 · 补帧 | 缺 |+| 11 | `f-color` | 专业 · 色彩(沿用现有调色页) | 缺 |+| 12 | `f-save` | 另存为预设 | 缺 |+| 13 | `f-manage` | 管理预设(重命名/复制/删除/设默认) | 缺 |+| 14 | `f-tonode` | 切换到节点模式(确认弹窗) | 缺 |+| 15 | `f-node` | 专业 · 节点(**wide**) | 有,但结构与读数不同 |+| 16 | `f-exp` | 导出(**按预设导出**) | 有,但概念不同 |+| 17 | `f-set` | 设置(**去掉了采集卡页**) | 部分 |++**已确认的关键概念错误(必须改,不是微调)**++1. **极简模式窗口跟随画幅。** 设计稿 `f-min` 的配置是 `aspect: 2.39`,说明文字是"窗口按画幅适配"、"进入时画面从中间展开,窗口高度弹性过渡到影片画幅"。我做的是固定 1280×800 窗口 + 内部留黑边,**方向就错了**。技术约束设计稿里也写明了:打开文件时读宽高比再调整窗口尺寸。+2. **专业页是 5 个标签**:画质 / 补帧 / 色彩 / 声音 / 显示。我只做了"参数"一块。+3. **补帧页要对照现有软件**:只列 DLSS 帧生成、Intel XeSS(实验);**AMD FSR 补帧保持隐藏**。+4. **节点模式画面下方要显示读数**:输入、输出、显示 fps、提交 fps、排队、链路总耗时;**每个节点标耗时**;底部彩色条是链路耗时条。+5. **导出"只从预设里选"**(列表预设或节点预设),码率可随意填写。我做的是"选文件 + 开始导出",概念不同。+6. **设置页去掉了采集卡页**(采集卡设置移到采集卡对话框里)。+7. **预设流程**:专业页右上角"预设"菜单 → 另存为 / 管理;另存为**先列出当前正在用的每个部分**再命名;列表预设与节点预设**分开**。++**验收方式(可执行,不靠印象)**++1. **逐屏截图比对**:用无头浏览器对设计稿的每一屏截图(`board.js` 的 `FRAMES` 逐项聚焦),再对同状态下的 QML 前端截图,人工逐屏比对。脚本落在 `tools/qt_probe/`(已有 `shot.ps1` 的基础)。+2. **状态必须对齐**:截图时 QML 端要喂与设计稿 `cfg` 相同的状态(同一页面、同一 `aspect`、`dockPinned`、同一 `tab`、同一 `dialog`),否则比的是两个不同场景。设计稿的 mock 数据(如 `1920×1080 · 60.00`)用于占位,不代表真实读数。+3. **不达标不进入 S5**:17 屏没有逐屏对齐并留下比对记录之前,不删除旧 Win32 界面。+4. **如实记录差异**:无法 1:1 的地方(例如设计稿里的 mock 读数、当前引擎确实没有的能力)必须逐条写明原因,不能悄悄放过,也不能用"接近了"糊过去。++**尚未决定、需要用户定夺的**:设计稿 `f-min` 要求窗口跟随影片画幅改变尺寸。这与当前"窗口尺寸由用户决定"的行为不同,也影响全屏/多显示器逻辑。实现前需要确认:是否所有入口(文件/采集卡/PS5/屏幕捕获)都跟随画幅,还是只有极简模式跟随。+### S4 QML 新界面(完整功能,一次到位)新建可执行目标 `veyra_qt`,只依赖 Facade,不直接接触引擎内部。diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.hindex 48029b7d..b6f5e992 100644--- a/include/veyra/ui/QmlPlayerBridge.h+++ b/include/veyra/ui/QmlPlayerBridge.h@@ -28,6 +28,7 @@#include <QVariantList>#include <QVariantMap>+#include <functional>#include <memory>#include "veyra/engine/EffectChain.h"@@ -240,6 +241,13 @@ public:// into it and Qt never touches its swapchain.void attachVideoWindow(qulonglong nativeHandle);+ // Run immediately before the engine opens a source. The presenter reads the+ // host window's client size once, when it initialises, and builds the+ // swapchain from it; a window that is still 0x0 at that moment yields a 1x1+ // surface that never recovers. The UI supplies this hook so the geometry is+ // settled at the one moment that matters, instead of racing a timer.+ void setPreOpenHook(std::function<void()> hook);+// --- commands exposed to QML -------------------------------------------// Every one returns immediately; none touches the GPU or waits for the// engine.diff --git a/prototypes/ui-redesign-2026-09-25/shot.html b/prototypes/ui-redesign-2026-09-25/shot.htmlnew file mode 100644index 00000000..3da3f68b--- /dev/null+++ b/prototypes/ui-redesign-2026-09-25/shot.html@@ -0,0 +1,52 @@+<title>Veyra 界面原型</title>+<link rel="preconnect" href="https://fonts.googleapis.com">+<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Noto+Sans+SC:wght@400;500;600;700&display=swap">+<link rel="stylesheet" href="board.css">+<link rel="stylesheet" href="app.css">+<link rel="stylesheet" href="pages.css">++<div class="hint"><img src="logo.png" alt=""><span><strong>Veyra 界面原型</strong> · 画面里的按钮都能点<span class="keys"> · 拖动空白处平移 · 滚轮平移,Ctrl+滚轮或双指缩放</span></span></div>++<div id="board" aria-label="设计画布">+ <div id="world"></div>+</div>++<div class="toolbar" role="toolbar" aria-label="画布工具">+ <div class="tb-group" data-jump>+ <button class="tb-btn" data-f="f-min">极简</button>+ <button class="tb-btn" data-f="f-cap">片源窗口</button>+ <button class="tb-btn" data-f="f-pro">专业列表</button>+ <button class="tb-btn" data-f="f-fg">补帧</button>+ <button class="tb-btn" data-f="f-save">预设</button>+ <button class="tb-btn" data-f="f-node">节点</button>+ <button class="tb-btn" data-f="f-exp">导出</button>+ </div>+ <span class="tb-sep"></span>+ <div class="tb-group">+ <button class="tb-btn" data-z="-" aria-label="缩小">−</button>+ <span class="tb-zoom" id="zoomv">100%</span>+ <button class="tb-btn" data-z="+" aria-label="放大">+</button>+ <button class="tb-btn" data-z="all">全部</button>+ </div>+ <span class="tb-sep"></span>+ <div class="tb-group">+ <span class="tb-label">强调色</span>+ <button class="tb-btn" data-acc="orange" aria-pressed="true">橙</button>+ <button class="tb-btn" data-acc="white" aria-pressed="false">白</button>+ </div>+ <div class="tb-group">+ <button class="tb-btn" id="tb-motion" aria-pressed="false">减少动画</button>+ </div>+</div>++<script src="icons.js"></script>+<script src="data.js"></script>+<script src="core.js"></script>+<script src="pages-a.js"></script>+<script src="dialogs.js"></script>+<script src="pages-pro.js"></script>+<script src="color.js"></script>+<script src="pages-node.js"></script>+<script src="presets.js"></script>+<script src="pages-b.js"></script>+<script src="board.js"></script>diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qmlindex 21c02d38..1598cfe7 100644--- a/qml/Veyra/Main.qml+++ b/qml/Veyra/Main.qml@@ -47,6 +47,73 @@ Window {border.color: Theme.stroke2}+ // The one place the native video window sits. There must be exactly ONE item+ // named videoHost in the tree: main.cpp finds it by name, and an earlier+ // version had a copy in each page, so the engine bound its swapchain to a+ // hidden page's zero-sized item and presented into a 1x1 window.+ //+ // The pages do not own the video; they declare where it should go (an item+ // named videoArea) and this follows the active page.+ Item {+ id: videoHost+ objectName: "videoHost"+ // Visible on every video page, not only once a source is open. It has to+ // be visible and correctly sized BEFORE the engine creates its swapchain:+ // the swapchain is built from this window's client size, and gating it on+ // hasSource meant the engine built it from a hidden 0x0 window and+ // presented into a 1x1 surface.+ visible: root.pageIsVideo+ z: 1+ }++ readonly property bool pageIsVideo: page === "minimal" || page === "pro" || page === "node"++ // Finds the video area of the page that is actually showing. Deliberately+ // scoped to the current page: reading every page's area is what caused the+ // 1x1 bug in the first place.+ //+ // The position is computed here rather than read from a child item's+ // geometry, because the page does not lay itself out until the frame after+ // the switch. On the frame the user opens a file, every child item still+ // reports 0x0, and the presenter then builds a 1x1 swapchain. So the host's+ // rect is derived from the same expressions the pages use, which are known+ // synchronously.+ function updateVideoHost() {+ // Computed from `page` directly, NOT from the pageIsVideo property: this+ // runs from onPageChanged, and a binding on `page` has not re-evaluated+ // at that point. Reading the property here returned the PREVIOUS page's+ // answer, so switching to a video page left the host at 0x0 and the+ // presenter built a 1x1 swapchain.+ const isVideo = (page === "minimal" || page === "pro" || page === "node")+ if (!isVideo) {+ videoHost.width = 0+ videoHost.height = 0+ return+ }+ if (page === "minimal") {+ videoHost.x = 0+ videoHost.y = 0+ videoHost.width = root.width+ videoHost.height = root.height+ } else if (page === "pro") {+ // Pro: full height on the left, the effect panel is a fixed 360 wide.+ videoHost.x = 0+ videoHost.y = 0+ videoHost.width = Math.max(1, root.width - 360)+ videoHost.height = Math.max(1, root.height - 44)+ } else {+ // Node: video on top, 40px toolbar between it and the canvas below.+ videoHost.x = 0+ videoHost.y = 0+ videoHost.width = Math.max(1, root.width)+ videoHost.height = Math.max(1, Math.round(Math.max(220, root.height * 0.42)))+ }+ }++ onPageChanged: updateVideoHost()+ onWidthChanged: updateVideoHost()+ onHeightChanged: updateVideoHost()+// Every page is instantiated once and kept alive: switching pages must not// rebuild the chain editor or lose a half-typed preset name.StackLayout {@@ -135,8 +202,11 @@ Window {}// The bridge drives page changes from engine-side commands too, so the dock- // and the engine never disagree about where the user is.+ // and the engine never disagree about where the user is. The host rect is+ // settled here as well: it must be correct before the first open, not one+ // frame later.Component.onCompleted: {if (!veyra.hasSource) root.page = "home"+ updateVideoHost()}}diff --git a/qml/Veyra/MinimalPage.qml b/qml/Veyra/MinimalPage.qmlindex 0853c259..16037c58 100644--- a/qml/Veyra/MinimalPage.qml+++ b/qml/Veyra/MinimalPage.qml@@ -36,7 +36,7 @@ Item {// insetting this would crop or letterbox the picture.Item {id: videoHost- objectName: "videoHost"+ objectName: "videoArea"anchors.fill: parent}diff --git a/qml/Veyra/NodePage.qml b/qml/Veyra/NodePage.qmlindex 1beafb6e..6ca206a7 100644--- a/qml/Veyra/NodePage.qml+++ b/qml/Veyra/NodePage.qml@@ -36,7 +36,7 @@ Item {Item {id: videoHost- objectName: "videoHost"+ objectName: "videoArea"anchors.fill: parentvisible: root.visible}diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qmlindex 5c67bfe0..f2099448 100644--- a/qml/Veyra/ProPage.qml+++ b/qml/Veyra/ProPage.qml@@ -33,7 +33,7 @@ Item {// the same HWND.Item {id: videoHost- objectName: "videoHost"+ objectName: "videoArea"anchors.fill: parentvisible: root.visible}diff --git a/qml/Veyra/Theme.qml b/qml/Veyra/Theme.qmlindex 3061c15f..884c9b15 100644--- a/qml/Veyra/Theme.qml+++ b/qml/Veyra/Theme.qml@@ -48,10 +48,12 @@ QtObject {readonly property int durationNormal: 220readonly property int durationSlow: 380// Overshooting curves, the QML equivalent of the prototype's- // cubic-bezier(.34,1.56,.64,1).- readonly property var spring: [0.34, 1.56, 0.64, 1.0, 1.0, 0.0]- readonly property var springSoft: [0.22, 1.25, 0.36, 1.0, 1.0, 0.0]- readonly property var easeOut: [0.2, 0.8, 0.2, 1.0, 1.0, 0.0]+ // cubic-bezier(.34,1.56,.64,1). QEasingCurve.BezierSpline takes exactly four+ // control points; passing six made every animation log "Invalid bezier curve"+ // and fall back to linear, which is why the interface did not spring.+ readonly property var spring: [0.34, 1.56, 0.64, 1.0]+ readonly property var springSoft: [0.22, 1.25, 0.36, 1.0]+ readonly property var easeOut: [0.2, 0.8, 0.2, 1.0]// --- type -------------------------------------------------------------readonly property string fontUi: "Microsoft YaHei UI"diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cppindex e5c6e4ba..4cbbbce5 100644--- a/src/ui/QmlPlayerBridge.cpp+++ b/src/ui/QmlPlayerBridge.cpp@@ -45,6 +45,7 @@ struct QmlPlayerBridge::Impl {// The window the engine presents into, and the last file the UI opened.HWND videoWindow = nullptr;std::wstring sourceLabel;+ std::function<void()> preOpen;// Export progress is mirror state: the engine reports an export through a// progress callback, and there is no export status in PlayerSnapshot yet.@@ -109,6 +110,10 @@ void QmlPlayerBridge::attachVideoWindow(qulonglong nativeHandle) {impl_->videoWindow = reinterpret_cast<HWND>(nativeHandle);}+void QmlPlayerBridge::setPreOpenHook(std::function<void()> hook) {+ impl_->preOpen = std::move(hook);+}+QString QmlPlayerBridge::appName() const { return QStringLiteral("Veyra"); }QString QmlPlayerBridge::version() const { return QStringLiteral(VEYRA_DISPLAY_VERSION); }@@ -402,8 +407,13 @@ void QmlPlayerBridge::openPath(const QString& path) {impl_->sourceLabel = wide;impl_->facade.noteRecentFile(wide);emit recentFilesChanged();- impl_->engine.open(impl_->videoWindow, wide, impl_->options);+ // Switch to a page with a video area, then settle the native window's+ // geometry, and only then open. The presenter samples the window's client+ // size once at initialisation; opening before that point is what produced a+ // 1x1 swapchain.emit navigate(QStringLiteral("minimal"));+ if (impl_->preOpen) impl_->preOpen();+ impl_->engine.open(impl_->videoWindow, wide, impl_->options);}void QmlPlayerBridge::togglePlayPause() { impl_->engine.pause(impl_->snapshot.running); }