fix: update m_preMaxFlag when window state changes#673
Conversation
Add m_preMaxFlag update in changeEvent to ensure tray icon restores correct window size after manual resize operations. 修复窗口状态改变时未更新最大化标志位的问题,确保托盘打开时能正确恢复窗口大小。 Log: 修复托盘打开窗口大小异常的问题 Bug: https://pms.uniontech.com/bug-view-244221.html Influence: 用户调整窗口大小后,通过托盘打开窗口时能正确恢复之前的大小
|
Hi @Resurgamz. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
CLA Assistant Lite bot: |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the main window’s changeEvent handler so that the pre-maximized-state flag (m_preMaxFlag) is kept in sync with window state changes, while avoiding interference with minimize-to-tray behavior, ensuring that restoring the window from the tray uses the correct size/maximized state after manual resizes. Flow diagram for updated window state change handlingflowchart TD
A[QEvent_WindowStateChange received in changeEvent] --> B[stopAnimation on m_playQueueWidget]
B --> C{isMinimized}
C -->|true| D[m_preMaxFlag unchanged]
C -->|false| E[set m_preMaxFlag = isMaximized]
E --> F[Tray restore uses m_preMaxFlag to restore window size]
D --> F
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider casting
eventtoQWindowStateChangeEventand using itsoldState()/newState()to drivem_preMaxFlagupdates, so you explicitly track transitions (e.g., avoid relying onisMinimized()checks that happen after the state change). - The new comment is helpful; consider expanding it slightly to clarify how this logic interacts with the tray minimize/restore path so future maintainers understand why minimization is treated specially.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider casting `event` to `QWindowStateChangeEvent` and using its `oldState()`/`newState()` to drive `m_preMaxFlag` updates, so you explicitly track transitions (e.g., avoid relying on `isMinimized()` checks that happen after the state change).
- The new comment is helpful; consider expanding it slightly to clarify how this logic interacts with the tray minimize/restore path so future maintainers understand why minimization is treated specially.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: max-lvs, Resurgamz The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Add m_preMaxFlag update in changeEvent to ensure tray icon restores correct window size after manual resize operations.
修复窗口状态改变时未更新最大化标志位的问题,确保托盘打开时能正确恢复窗口大小。
Log: 修复托盘打开窗口大小异常的问题
Bug: https://pms.uniontech.com/bug-view-244221.html
Influence: 用户调整窗口大小后,通过托盘打开窗口时能正确恢复之前的大小
Summary by Sourcery
Bug Fixes: