Skip to content

revert: remove automatic focus setting on launcher visibility#733

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Ivy233:revert-focus-fix
Mar 12, 2026
Merged

revert: remove automatic focus setting on launcher visibility#733
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Ivy233:revert-focus-fix

Conversation

@Ivy233
Copy link
Contributor

@Ivy233 Ivy233 commented Mar 12, 2026

This reverts commit a8dd424. Remove the forceActiveFocus() call on search edit when launcher becomes visible, restoring the previous behavior where focus management was handled differently.

回退自动设置启动器可见时的焦点功能。移除启动器可见时对搜索框调用
forceActiveFocus() 的代码,恢复之前的焦点管理行为。

PMS: BUG-301743

Summary by Sourcery

Bug Fixes:

  • Restore previous launcher focus behavior by removing forced focus on the search input when the launcher is shown.

This reverts commit a8dd424.
Remove the forceActiveFocus() call on search edit when launcher becomes
visible, restoring the previous behavior where focus management was
handled differently.

回退自动设置启动器可见时的焦点功能。移除启动器可见时对搜索框调用
forceActiveFocus() 的代码,恢复之前的焦点管理行为。

PMS: BUG-301743
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 12, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Reverts the behavior that automatically focused the launcher search field when the launcher became visible, while keeping the cleanup behavior that runs when the launcher hides.

Sequence diagram for launcher visibility and search focus handling

sequenceDiagram
    actor User
    participant LauncherController
    participant WindowedFrame
    participant WindowedSearchEdit as Windowed_searchEdit
    participant FullscreenFrame
    participant FullscreenSearchEdit as Fullscreen_searchEdit

    User->>LauncherController: set visible true
    LauncherController-->>WindowedFrame: onVisibleChanged(true)
    WindowedFrame->>WindowedFrame: check LauncherController.visible
    WindowedFrame-->>WindowedSearchEdit: no action (focus not changed)
    LauncherController-->>FullscreenFrame: onVisibleChanged(true)
    FullscreenFrame->>FullscreenFrame: check LauncherController.visible
    FullscreenFrame-->>FullscreenSearchEdit: no action (focus not changed)

    User->>LauncherController: set visible false
    LauncherController-->>WindowedFrame: onVisibleChanged(false)
    WindowedFrame->>WindowedFrame: if not visible perform cleanup
    WindowedFrame->>WindowedSearchEdit: set text ""
    WindowedFrame->>WindowedSearchEdit: clear focus

    LauncherController-->>FullscreenFrame: onVisibleChanged(false)
    FullscreenFrame->>FullscreenFrame: if not visible perform cleanup
    FullscreenFrame->>FullscreenSearchEdit: set text ""
    FullscreenFrame->>FullscreenSearchEdit: clear focus and selection state
Loading

File-Level Changes

Change Details Files
Restore previous focus behavior by no longer auto-focusing the search input when the launcher becomes visible, while still cleaning up state when it hides.
  • Remove forceActiveFocus() calls on the search edit when the launcher visibility changes to visible in both windowed and fullscreen launchers.
  • Retain and guard the cleanup logic (clearing search text, resetting focus, and related state) so it only runs when the launcher becomes hidden.
qml/windowed/WindowedFrame.qml
qml/FullscreenFrame.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The onVisibleChanged handlers in WindowedFrame.qml and FullscreenFrame.qml now share nearly identical visibility-check and cleanup logic; consider extracting this into a shared helper or component to avoid divergence in future tweaks.
  • Given the early-return pattern for LauncherController.visible, it may be clearer to invert the condition to if (!LauncherController.visible) { ... } and drop the return, which makes the intent (“run this block only when hidden”) more explicit.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `onVisibleChanged` handlers in `WindowedFrame.qml` and `FullscreenFrame.qml` now share nearly identical visibility-check and cleanup logic; consider extracting this into a shared helper or component to avoid divergence in future tweaks.
- Given the early-return pattern for `LauncherController.visible`, it may be clearer to invert the condition to `if (!LauncherController.visible) { ... }` and drop the `return`, which makes the intent (“run this block only when hidden”) more explicit.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, Ivy233

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Ivy233
Copy link
Contributor Author

Ivy233 commented Mar 12, 2026

/merge

@deepin-bot
Copy link

deepin-bot bot commented Mar 12, 2026

This pr cannot be merged! (status: behind)

@Ivy233
Copy link
Contributor Author

Ivy233 commented Mar 12, 2026

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Mar 12, 2026

This pr force merged! (status: behind)

@deepin-bot deepin-bot bot merged commit f897121 into linuxdeepin:master Mar 12, 2026
9 of 10 checks passed
@Ivy233 Ivy233 deleted the revert-focus-fix branch March 12, 2026 09:13
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.

3 participants