-
Notifications
You must be signed in to change notification settings - Fork 55
fix: disable dynamic sort filter in task manager proxy model #1343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. Set dynamic sort filter to false in TaskManagerProxyModel constructor 2. This prevents automatic resorting when source model data changes 3. Improves performance by reducing unnecessary sorting operations 4. Maintains stable task ordering in the dock panel fix: 在任务管理器代理模型中禁用动态排序过滤器 主要问题在于,关闭wine应用窗口,abstractmonitor发出datachanged后,会导致出现一个insert信号, 原因是出现在taskmanager的boolfilter,Qt内部的QSortilter会出发排序,会触发insert信号,从而多了重复窗口被加入。 后续出现相关类型其他问题,比如出现tooltip,popup等等窗口出现在任务栏,可以优先看这里的问题。 PMS: BUG-339345
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR disables dynamic sorting in the TaskManager proxy model by adding a single call to setDynamicSortFilter(false) in the BoolFilterModel constructor, preventing automatic resorting on source model updates to improve performance and maintain stable task ordering. Class diagram for updated BoolFilterModel constructorclassDiagram
class BoolFilterModel {
+BoolFilterModel(QObject* parent, QAbstractItemModel* sourceModel, int role)
+setDynamicSortFilter(bool)
}
BoolFilterModel --|> QSortFilterProxyModel
BoolFilterModel --|> AbstractTaskManager
QSortFilterProxyModel <|-- BoolFilterModel
AbstractTaskManager <|-- BoolFilterModel
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来帮你分析这段代码的修改:
// 禁用动态排序过滤以提高性能,避免源模型频繁变化时的不必要重计算
setDynamicSortFilter(false);
总的来说,这是一个很好的性能优化改动,但建议添加注释说明原因,以便其他开发者理解这个设计决策。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where closing Wine application windows causes duplicate window entries in the taskbar. The issue stems from Qt's QSortFilterProxyModel automatically re-sorting when source model data changes, which triggers unexpected insert signals in the BoolFilterModel. The fix disables dynamic sorting to prevent these spurious insert events.
Key changes:
- Added
setDynamicSortFilter(false)to the BoolFilterModel constructor to disable automatic re-filtering/re-sorting on source data changes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/forcemerge |
|
This pr force merged! (status: behind) |
fix: 在任务管理器代理模型中禁用动态排序过滤器
主要问题在于,关闭wine应用窗口,abstractmonitor发出datachanged后,会导致出现一个insert信号, 原因是出现在taskmanager的boolfilter,Qt内部的QSortilter会出发排序,会触发insert信号,从而多了重复窗口被加入。
后续出现相关类型其他问题,比如出现tooltip,popup等等窗口出现在任务栏,可以优先看这里的问题。
PMS: BUG-339345
Summary by Sourcery
Disable dynamic sorting in the task manager proxy model to avoid automatic re-sorting and redundant insert signals on data changes, thereby preventing duplicate entries, boosting performance, and preserving task order.
Bug Fixes:
Enhancements: