fix(popup): remove focus workaround - #658
Conversation
1. Remove native popup activation and parent focus restoration from PopupHandle. 2. Drop ComboBox focus event filtering after moving popup input focus handling to QtBase. 3. Remove the obsolete workaround test while retaining popup handle creation coverage. Log: Let QtBase manage logical input focus for non-activating popups. Influence: Popup input requires the matching QtBase fix. fix(popup): 移除焦点变通逻辑 1. 移除 PopupHandle 对原生弹窗的激活和父级焦点恢复逻辑。 2. 输入焦点处理迁移到 QtBase 后,删除 ComboBox 焦点事件过滤。 3. 删除过时的变通测试,同时保留弹窗句柄创建覆盖。 Log: 由 QtBase 统一管理非激活弹窗的逻辑输入焦点。 PMS: BUG-372273 Influence: 弹窗输入依赖配套的 QtBase 修复。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves the custom popup focus management and ComboBox-specific focus workaround now that QtBase owns popup input focus handling, and cleans up the associated test and dependencies while keeping basic popup handle behavior covered. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 以下为清理后的 dpopupwindowhandle_p.h 核心结构示例
// 展示移除冗余焦点管理变量后的简洁状态
class DPopupWindowHandle : public QObject, public QQuickItemChangeListener
{
Q_OBJECT
private Q_SLOTS:
void updateEnabled();
void onWindowChanged(QQuickWindow *window);
private:
QQuickWindow *popupWindow() const;
QQuickItem *popupItem() const;
void popupItemReparented();
bool isEnabled() const;
void adjustPopupPosition();
private:
QObject *m_popup = nullptr;
bool m_enabled = false;
QPointer<QQuickWindow> m_parentWindow = nullptr;
QPointer<QQuickWindow> m_popupWin = nullptr;
QPointer<QQuickItem> m_trackedItem = nullptr;
// 已安全移除:m_restoreFocusItem, m_focusOwner, m_popupFocusRequested
}; |
Summary
PopupHandleVerification
unit-testut_DPopupWindowHandle.popupWindowCreatesHandle: passedut_DComboBox.popupTypeSelectsMatchingBackground: passedRequires: deepin-community/qt6-base#55
PMS: https://pms.uniontech.com/bug-view-372273.html
Summary by Sourcery
Simplify popup window handling now that QtBase manages popup focus, and clean up related tests.
Bug Fixes:
Enhancements: