Skip to content

🐞 fix: 改善主窗口在桌面歌词区域移动/调整大小时的闪烁问题#674

Merged
imsyy merged 4 commits into
SPlayer-Dev:devfrom
Yueby:fix/desktop-lyric-flicker
Dec 28, 2025
Merged

🐞 fix: 改善主窗口在桌面歌词区域移动/调整大小时的闪烁问题#674
imsyy merged 4 commits into
SPlayer-Dev:devfrom
Yueby:fix/desktop-lyric-flicker

Conversation

@Yueby
Copy link
Copy Markdown
Contributor

@Yueby Yueby commented Dec 27, 2025

  • 监听主窗口 move/resize 事件,在操作时临时禁用桌面歌词的 forward 参数
  • 操作结束后自动恢复,避免影响悬浮解锁功能
  • 已知问题:窗口重叠时首次操作仍可能出现轻微闪烁(事件触发延迟导致)

- 监听主窗口 move/resize 事件,在操作时临时禁用桌面歌词的 forward 参数
- 操作结束后自动恢复,避免影响悬浮解锁功能
- 已知问题:窗口重叠时首次操作仍可能出现轻微闪烁(事件触发延迟导致)
- 监听主窗口 move/resize 事件,在操作时临时禁用桌面歌词的 forward 参数
- 操作结束后自动恢复,避免影响悬浮解锁功能
- 已知问题:窗口重叠时首次操作仍可能出现轻微闪烁(事件触发延迟导致)
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Yueby, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在通过在主窗口移动或调整大小时智能地管理桌面歌词窗口的鼠标事件穿透行为,从而显著改善用户体验。通过临时禁用并随后恢复 "forward" 参数,解决了桌面歌词在这些操作期间出现的视觉闪烁问题,同时保持了悬浮解锁功能的完整性。

Highlights

  • 解决桌面歌词闪烁问题: 在主窗口移动或调整大小时,临时禁用桌面歌词窗口的鼠标事件穿透("forward" 参数),以避免视觉闪烁。
  • 自动恢复鼠标事件穿透: 主窗口操作结束后,通过防抖机制自动恢复桌面歌词窗口的鼠标事件穿透,确保悬浮解锁功能正常。
  • 平台兼容性处理: 针对 Linux 平台不支持 "moved"/"resized" 事件的特性,进行了特殊处理,仅在 Windows/macOS 上监听这些事件以优化性能和行为。
  • 已知问题: 窗口重叠时,首次操作仍可能出现轻微闪烁,这是由于事件触发存在延迟。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

本次 PR 旨在通过在主窗口移动/调整大小时临时禁用鼠标事件转发,来修复桌面歌词窗口的闪烁问题。您采用的方案非常可靠:在支持的平台(Windows/macOS)上使用 moved/resized 事件立即恢复状态,而在其他平台上则通过 move/resize 事件配合防抖定时器来恢复。代码通过新的辅助函数进行了良好的结构化,提高了可读性。

然而,我在事件监听器的清理逻辑中发现了一个严重问题。removeAllListeners 的使用会无意中移除主窗口上其他重要的监听器,可能导致保存窗口位置和大小等功能失效。我已在具体的审查评论中提供了详细说明和修复建议。

在解决此问题后,这些更改应能有效解决所描述的闪烁问题。

Comment thread electron/main/ipc/ipc-lyric.ts
@imsyy imsyy merged commit 1217d26 into SPlayer-Dev:dev Dec 28, 2025
@Yueby Yueby deleted the fix/desktop-lyric-flicker branch December 31, 2025 09:21
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