Skip to content

Add window opacity controls and automatic hiding on mouse leave - #1322

Open
Vae-x wants to merge 1 commit into
barry-ran:devfrom
Vae-x:feat/window-opacity-auto-hide
Open

Vae-x wants to merge 1 commit into
barry-ran:devfrom
Vae-x:feat/window-opacity-auto-hide

Conversation

@Vae-x

@Vae-x Vae-x commented Oct 23, 2026

Copy link
Copy Markdown

Summary

Add opacity and optional automatic hiding controls to the connected device's side toolbar.

  • Adjust opacity from 10% to 100%, keeping the video window, toolbar and owned popups synchronized.
  • After the pointer leaves for 300 ms, reduce opacity to 1/255; restore the selected opacity after 300 ms of actual hovering. Preserve mouse hit testing, window stacking and the device connection.
  • Account for occlusion, detached toolbars, menus, dragging, mouse capture and input-method candidate windows. Save settings per device and use matching top/bottom toolbar margins.
  • Support the existing Qt 6/MinGW build path with explicit Windows library linking, resource-version fixes and a parameterized portable-package script. Include usage documentation and native/UI regression tests.

Validation

  • Windows 11, Qt 6.10.1, MinGW 13.1 x64: Release build and portable-package startup succeeded.
  • Native window-controller QtTest: 11 passed, 0 failed, 0 skipped.
  • Production VideoForm/ToolForm integration QtTest, including real OpenGL compositing, slider interaction and settings persistence: 4 passed, 0 failed, 0 skipped.
  • The final toolbar-margin adjustment was rebuilt; the automated test results above precede that spacing-only adjustment. The public build-script path changes were syntax-checked.
  • Linux and macOS were not tested.

Comment thread QtScrcpy/ui/toolform.cpp
m_opacitySlider->setSingleStep(1);
m_opacitySlider->setPageStep(10);
m_opacitySlider->setTracking(true);
m_opacitySlider->setAccessibleName(tr("窗口不透明度"));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考其他地方,代码中的所有硬编码文案应该都是英文

Comment thread QtScrcpy/CMakeLists.txt
VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
VERSION_MINOR=${PROJECT_VERSION_MINOR}
VERSION_PATCH=${PROJECT_VERSION_PATCH}
VERSION_RC_STR="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个为什么删了


连接设备后,右侧工具栏顶部新增两个按钮:

- **透明度**:打开滑块,手动调节投屏窗口和工具栏的不透明度。范围为 10%–100%,数值越低越透明;拖动时即时生效。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么不能是0-100

void start()
{
if (!imeHook) {
imeHook = SetWinEventHook(0x8027, 0x8029, nullptr, imeEvent, 0, 0,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hook ime的原因是什么

@@ -0,0 +1,38 @@
# 投屏窗口透明度与自动隐身

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

回答其他问题前先回答这个问题:为什么要加这个功能?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants