fix(popup): close window popup on outside touch#652
Merged
Conversation
1. Handle touch presses delivered to the parent window as outside presses. 2. Detect grabbed touch presses outside the popup using local coordinates. Log: Close window popups when users touch outside them. Influence: Restores outside-touch closing for popups. fix(popup): 支持触摸外部区域关闭窗口弹窗 1. 将父窗口收到的触摸按下事件作为弹窗外部操作处理。 2. 使用局部坐标识别被弹窗抓取的外部触摸事件。 Log: 修复触摸弹窗外部区域时窗口弹窗无法关闭的问题。 PMS: BUG-370839 Influence: 恢复弹窗的外部触摸关闭行为。
Contributor
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 代码已具备良好质量,此处提供微小的可读性优化建议,减少链式调用
static bool isTouchOutsideWindow(const QTouchEvent *event, const QWindow *window)
{
if (!window)
return false;
const auto points = event->points();
if (points.isEmpty())
return false;
const QRectF windowRect(QPointF(), QSizeF(window->size()));
return !windowRect.contains(points.constFirst().position());
} |
18202781743
approved these changes
Jul 24, 2026
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log: Close window popups when users touch outside them.
Influence: Restores outside-touch closing for popups.
fix(popup): 支持触摸外部区域关闭窗口弹窗
Log: 修复触摸弹窗外部区域时窗口弹窗无法关闭的问题。
PMS: BUG-370839
Influence: 恢复弹窗的外部触摸关闭行为。