Skip to content

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++

fix(ui): keep subtitle popup anchor visible during button clicks

Veyra Goal Agent4bce05e040d5
diff --git a/apps/veyra/ui/Theme.h b/apps/veyra/ui/Theme.h
index 0b09dcd2..310d71a5 100644
--- a/apps/veyra/ui/Theme.h
+++ b/apps/veyra/ui/Theme.h
@@ -92,7 +92,10 @@ inline LRESULT CALLBACK buttonPaint(HWND h,UINT m,WPARAM w,LPARAM l,UINT_PTR,DWO
if(ico!=Icon::None){drawIcon(dc,ico,caption?float(dip(h,18)):r.right/2.f,r.bottom/2.f,float(dip(h,ico==Icon::Play||ico==Icon::Pause?22:17)),ink);if(caption){r.left=dip(h,34);glassText(dc,value,-1,&r,DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS);}}
else if((GetWindowLongPtrW(h,GWL_STYLE)&BS_TYPEMASK)==BS_AUTOCHECKBOX){RECT toggle{r.right-dip(h,40),r.bottom/2-dip(h,8),r.right-dip(h,10),r.bottom/2+dip(h,8)};roundRect(dc,toggle,check?accent:line,dip(h,8));RECT knob{toggle.left+dip(h,check?16:3),toggle.top+dip(h,3),toggle.left+dip(h,check?26:13),toggle.top+dip(h,13)};roundRect(dc,knob,check?panel:secondary,dip(h,5));r.left=dip(h,12);r.right-=dip(h,46);glassText(dc,value,-1,&r,DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS);}else glassText(dc,value,-1,&r,DT_CENTER|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS);
if(GetFocus()==h&&!(SendMessageW(h,WM_QUERYUISTATE,0,0)&UISF_HIDEFOCUS)){RECT outline{};GetClientRect(h,&outline);InflateRect(&outline,-3,-3);AlphaGraphics focusDrawing(dc);auto& focus=focusDrawing.get();focus.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);Gdiplus::GraphicsPath path;rounded(path,{float(outline.left),float(outline.top),float(outline.right-outline.left),float(outline.bottom-outline.top)},float(dip(h,6)));Gdiplus::Pen stroke(color(accent,145),1);focus.DrawPath(&stroke,&path);}SelectObject(dc,old);return 0;}
- if(controlVisualChange(m)||m==BM_SETCHECK||m==BM_SETSTATE||m==BM_SETSTYLE||m==WM_MOUSEMOVE||m==WM_MOUSELEAVE||m==WM_LBUTTONDOWN||m==WM_LBUTTONUP)return updateControlModel(h,m,w,l);
+ // Click dispatch can enter a modal popup through BN_CLICKED. WM_SETREDRAW
+ // removes WS_VISIBLE, so never hold suppression across input dispatch.
+ // Native pressed-state changes still use the buffered BM_SETSTATE path.
+ if(controlVisualChange(m)||m==BM_SETCHECK||m==BM_SETSTATE||m==BM_SETSTYLE||m==WM_MOUSEMOVE||m==WM_MOUSELEAVE)return updateControlModel(h,m,w,l);
return DefSubclassProc(h,m,w,l);
}
}
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 37588084..a26f9598 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,17 @@
# Veyra 工作记录
+## 2026-09-19 字幕按钮弹窗立即关闭修复
+
+分支 `codex/subtitle-popup-20260919`,基线 `fd67b58`。`Theme.h` 的按钮鼠标消息曾在 `WM_SETREDRAW(FALSE)` 内调用原生按钮过程;`WM_LBUTTONUP` 同步发出 `BN_CLICKED` 并进入字幕菜单消息循环。此时按钮的 `WS_VISIBLE` 被临时移除,菜单 100ms 的锚点检查关闭弹窗。旧代码真实复现:菜单打开约 100ms 后 selection=-1,新增测试报告按钮在通知期间不可见。
+
+修复 `apps/veyra/ui/Theme.h`:鼠标按下/抬起不再包裹 redraw suppression;按压状态的 `BM_SETSTATE` 与其他视觉状态仍走缓冲重绘。不放宽弹窗对隐藏/禁用/销毁锚点的关闭检查。`tests/integration/PopupSelectorTests.cpp` 新增真实主题按钮鼠标消息、BM_CLICK、空格键三条同步通知路径,菜单等待至少 300ms 后选择第二项,并检查可见性与弹窗状态回收。
+
+实际构建:`scripts/build-isolated.ps1 -Root . -BuildDirectory E:/项目/Veyra/build/subtitle-popup-20260919 -DependencyCache E:/项目/Veyra/build/frame-pacing-20260918/CMakeCache.txt -TempDirectory E:/项目/Veyra/tmp/subtitle-popup-20260919 -DisplayVersion 1.4.2 -Targets veyra_popup_selector_tests,veyra`,exit0;最终测试源码重编译 exit0。日志目录 `E:/项目/Veyra/logs/subtitle-popup-20260919/`,含 build.log、final-build.log。所有新产物在 E 盘对应 build/logs/tmp 下,无新 SDK 或运行库进入 Git。
+
+验证:`scripts/run-short-test.ps1 -Exe E:/项目/Veyra/build/subtitle-popup-20260919/veyra_popup_selector_tests.exe -Arguments --test -TimeoutSeconds 30 -LogPrefix E:/项目/Veyra/logs/subtitle-popup-20260919/final`,exit0,case0-17全部通过,含原有悬停、取消、Tab、隐藏、禁用、销毁测试。before日志为旧版失败证据;after/fixed两次误用了未重编译的测试二进制,仍失败,不算修复验证;修改测试源强制重编后 trace/final 均通过。未扩大改动到构建依赖跟踪。
+
+应用短测:同一 runner 运行新 `veyra.exe --smoke-empty --smoke-seconds 5`,30秒限时,exit0。PATH 临时加入现有 1.4.2 便携目录以提供运行依赖,VEYRA_LOG_FILE 指向同目录 app-smoke.log;TEMP/TMP仅对子进程设置到本轮 tmp。新版应用完成全量构建,未沿用旧 AppShell 对象。本轮未执行 NGX Create/Evaluate、媒体字幕渲染或人工整机交互验收;改动仅为 UI 按钮事件生命周期。没有推送或替换 GitHub Release。交付为 build/subtitle-popup-20260919/veyra.exe,可放入已有 1.4.2 完整便携目录替换主程序。
+
## 2026-09-19 1.4.2 正式发布验收
发布完成:https://github.com/Likely7/Veyra-NRVideo/releases/tag/v1.4.2 。main与标签发布提交274d826;本条为发布后文档记录,不改变标签源码或可执行文件。四资产均uploaded,GitHub digest/大小与本地一致:便携472315996字节,SHA256 6C425177854DECD1FC4ED0D5BBECEFECE114AD28B72C638D7A5786CFC3210890;对应源码214922039字节,SHA256 71B3B8C8A21A577D1B1802DB6BDFCA3377B3AE513560F8F7DCF23BE1E4BD0467;另附两个.sha256。源码ZIP824文件回读验证。Release由草稿转为正式并设置latest。README与Release新群图、赞助图各220宽,三张远端图片HTTP200且PNG/JPEG文件头正确。新群码图示有效期至9月26日。便携包120文件manifest校验通过,12项运行组件保留身份和许可记录,未混入SDK/模型/用户配置/测试媒体。当前可用构建、最终交付包及验收证据均在E:/项目/Veyra/;旧测试中间副本此前清理被自动审批拒绝,本轮未绕过重删。
diff --git a/tests/integration/PopupSelectorTests.cpp b/tests/integration/PopupSelectorTests.cpp
index d7c1ae3d..010953d9 100644
--- a/tests/integration/PopupSelectorTests.cpp
+++ b/tests/integration/PopupSelectorTests.cpp
@@ -3,12 +3,21 @@
#include <stdexcept>
namespace {
HWND owner=nullptr,combo=nullptr,next=nullptr,previous=nullptr;int action=0,steps=0;std::vector<int> notifications;
+int buttonChoice=-1;bool anchorVisible=false;ULONGLONG openedAt=0;
void require(bool condition,const char* reason){if(!condition)throw std::runtime_error(reason);}
LRESULT CALLBACK proc(HWND h,UINT m,WPARAM w,LPARAM l){
+ if(m==WM_COMMAND&&LOWORD(w)==11&&HIWORD(w)==BN_CLICKED&&action>=15){
+ anchorVisible=IsWindowVisible(next)!=FALSE;openedAt=GetTickCount64();
+ buttonChoice=veyra::ui::popupSelector(next,{{1,L"Subtitles"},{2,L"Audio"}},0);
+ return 0;
+ }
if(m==WM_COMMAND&&LOWORD(w)==10){notifications.push_back(HIWORD(w));if(action==8&&HIWORD(w)==CBN_DROPDOWN)SendMessageW(combo,CB_SHOWDROPDOWN,FALSE,0);if(action==11&&HIWORD(w)==CBN_SELENDOK)DestroyWindow(combo);if(action==12&&HIWORD(w)==CBN_DROPDOWN)DestroyWindow(owner);return 0;}
if(m==WM_TIMER){using namespace veyra::ui;if(!activeSelector)return 0;auto list=GetDlgItem(activeSelector,1);++steps;
if(steps>10){cancelPopupSelector();return 0;}
switch(action){
+ case 15:case 16:case 17:
+ if(GetTickCount64()-openedAt>=300){SendMessageW(list,WM_KEYDOWN,VK_DOWN,0);SendMessageW(list,WM_KEYDOWN,VK_RETURN,0);}else --steps;
+ break;
case 0:SendMessageW(list,WM_KEYDOWN,VK_DOWN,0);SendMessageW(list,WM_KEYDOWN,VK_RETURN,0);break;
case 1:SendMessageW(list,WM_KEYDOWN,VK_DOWN,0);SendMessageW(list,WM_KEYDOWN,VK_ESCAPE,0);break;
case 2:SendMessageW(combo,CB_SHOWDROPDOWN,FALSE,0);break;
@@ -30,14 +39,22 @@ bool notified(int code){return std::find(notifications.begin(),notifications.end
int wmain(){ULONG_PTR gdiplus=0;Gdiplus::GdiplusStartupInput input;Gdiplus::GdiplusStartup(&gdiplus,&input,nullptr);int result=0;
try{
INITCOMMONCONTROLSEX common{sizeof(common),ICC_STANDARD_CLASSES};InitCommonControlsEx(&common);WNDCLASSW wc{};wc.lpfnWndProc=proc;wc.lpszClassName=L"VeyraSelectorContract";wc.hInstance=GetModuleHandleW(nullptr);RegisterClassW(&wc);
- for(action=0;action<=14;++action){
+ for(action=0;action<=17;++action){
owner=CreateWindowExW(WS_EX_CONTROLPARENT,wc.lpszClassName,L"Veyra popup interaction test",WS_OVERLAPPEDWINDOW,20,20,480,320,nullptr,nullptr,wc.hInstance,nullptr);
previous=CreateWindowExW(0,L"BUTTON",L"previous",WS_CHILD|WS_VISIBLE|WS_TABSTOP,20,5,100,24,owner,HMENU(9),wc.hInstance,nullptr);
combo=CreateWindowExW(0,L"COMBOBOX",L"choices",WS_CHILD|WS_VISIBLE|WS_TABSTOP|CBS_DROPDOWNLIST,20,40,300,200,owner,HMENU(10),wc.hInstance,nullptr);veyra::ui::themeControl(combo);
next=CreateWindowExW(0,L"BUTTON",L"next",WS_CHILD|WS_VISIBLE|WS_TABSTOP,20,100,100,32,owner,HMENU(11),wc.hInstance,nullptr);
+ veyra::ui::themeControl(next);
// First ShowWindow consumes the runner's STARTUPINFO SW_HIDE.
ShowWindow(owner,SW_HIDE);ShowWindow(owner,SW_SHOW);SetForegroundWindow(owner);SetActiveWindow(owner);
for(int i=0;i<33;++i){auto label=L"Option "+std::to_wstring(i);SendMessageW(combo,CB_ADDSTRING,0,LPARAM(label.c_str()));}SendMessageW(combo,CB_SETCURSEL,4,0);SetFocus(combo);notifications.clear();steps=0;SetTimer(owner,1,20,nullptr);
+ if(action>=15){
+ buttonChoice=-1;anchorVisible=false;SetFocus(next);
+ if(action==15){SendMessageW(next,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(10,10));SendMessageW(next,WM_LBUTTONUP,0,MAKELPARAM(10,10));}
+ else if(action==16)SendMessageW(next,BM_CLICK,0,0);
+ else{SendMessageW(next,WM_KEYDOWN,VK_SPACE,0);SendMessageW(next,WM_KEYUP,VK_SPACE,0);}
+ KillTimer(owner,1);require(anchorVisible,"button must stay visible during synchronous click notification");require(buttonChoice==1,"button popup survives anchor timer and commits after 300ms");require(!veyra::ui::popupSelectorOpen()&&!veyra::ui::activeSelector,"button popup cleans up");require(IsWindowVisible(next)&&!GetPropW(next,L"SysSetRedraw"),"button redraw restored");DestroyWindow(owner);std::cout<<"PASS popup button case "<<action<<"\n";continue;
+ }
SendMessageW(combo,CB_SHOWDROPDOWN,TRUE,0);if(IsWindow(owner))KillTimer(owner,1);require(action==8||action==12?steps==0:steps>0&&steps<=10,"bounded popup closed including synchronous cancellation");require(!veyra::ui::popupSelectorOpen()&&!veyra::ui::activeSelector,"popup releases all active state");
if(action>=9&&action<=12){require(!IsWindow(combo),"destroyed combo stays destroyed");if(action==10||action==12)require(!IsWindow(owner),"destroyed owner stays destroyed");if(IsWindow(owner))DestroyWindow(owner);std::cout<<"PASS popup case "<<action<<"\n";continue;}
require(!SendMessageW(combo,CB_GETDROPPEDSTATE,0,0),"collapse reports closed");require(notified(CBN_DROPDOWN)&&notified(CBN_CLOSEUP),"native dropdown lifecycle notifications");