Skip to content

fix: allow lockscreen shortcut in multitaskview mode#1016

Draft
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:fix/lockscreen-shortcut-multitaskview
Draft

fix: allow lockscreen shortcut in multitaskview mode#1016
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:fix/lockscreen-shortcut-multitaskview

Conversation

@deepin-wm

@deepin-wm deepin-wm commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix Super+L lockscreen shortcut not responding in multitask view mode.

Changes

  1. shortcutrunner.cpp — Extended Lockscreen and ShutdownMenu action conditions to include Multitaskview mode (previously only Normal mode was allowed)
  2. shortcutrunner.cpp — Added immediatelyExit() and deleteTaskSwitch() calls in ShutdownMenu branch to properly exit multitask view before entering lockscreen
  3. helper.cpp — Extended handleLockScreen three callbacks (shutdown, lock, switchUser) to support Multitaskview mode
  4. helper.cpp — Added immediatelyExit() and deleteTaskSwitch() in handleLockScreen callbacks to properly transition from multitask view to lockscreen

Bug Reference

进入多任务视图后,键入 Super+L 锁屏快捷键无响应,但在普通桌面状态下可以正常工作。

Root cause: ShortcutRunner::onActionTrigger and Helper::handleLockScreen callbacks explicitly checked currentMode() == CurrentMode::Normal, silently ignoring the action when in Multitaskview mode.

Testing

  • Super+L works in normal desktop mode
  • Super+L works in multitask view mode
  • Shutdown menu shortcut works in both modes
  • Lockscreen D-Bus callbacks work in multitask view mode

Summary by Sourcery

Allow lockscreen and shutdown shortcuts to work correctly when the shell is in multitask view mode.

Bug Fixes:

  • Ensure the lockscreen shortcut (e.g., Super+L) and shutdown menu respond in multitask view mode instead of being ignored.
  • Fix lockscreen D-Bus callbacks so they correctly transition from multitask view to the lock screen.

Enhancements:

  • Unify lockscreen-related handling so transitions from multitask view exit the view and task switch cleanly before entering the lock screen state.

1. Extend Lockscreen action condition to include Multitaskview mode
2. Extend ShutdownMenu action condition to include Multitaskview mode
3. Add immediatelyExit and deleteTaskSwitch calls in ShutdownMenu
4. Extend handleLockScreen three callbacks to support Multitaskview
5. Add immediatelyExit and deleteTaskSwitch in handleLockScreen callbacks

Log: Fixed Super+L lockscreen shortcut not working in multitask view

Influence:
1. Test Super+L lockscreen shortcut in multitask view mode
2. Test Super+L lockscreen shortcut in normal desktop mode
3. Test shutdown menu shortcut in multitask view mode
4. Test shutdown menu shortcut in normal desktop mode
5. Test lockscreen D-Bus callbacks in multitask view mode

fix: 允许多任务视图下使用锁屏快捷键

1. 扩展 Lockscreen 动作条件以包含 Multitaskview 模式
2. 扩展 ShutdownMenu 动作条件以包含 Multitaskview 模式
3. 在 ShutdownMenu 中添加 immediatelyExit 和 deleteTaskSwitch 调用
4. 扩展 handleLockScreen 三个回调以支持 Multitaskview 模式
5. 在 handleLockScreen 回调中添加 immediatelyExit 和 deleteTaskSwitch

Log: 修复多任务视图下 Super+L 锁屏快捷键无响应的问题

Influence:
1. 测试多任务视图下 Super+L 锁屏快捷键
2. 测试普通桌面模式下 Super+L 锁屏快捷键
3. 测试多任务视图下关机菜单快捷键
4. 测试普通桌面模式下关机菜单快捷键
5. 测试多任务视图下锁屏 D-Bus 回调
@sourcery-ai

sourcery-ai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

Extends lockscreen- and shutdown-related shortcuts and D-Bus callbacks to work when the compositor is in Multitaskview mode, ensuring proper exit from multitask view before transitioning to the lockscreen or shutdown UI.

Sequence diagram for lockscreen shortcut from Multitaskview mode

sequenceDiagram
    actor User
    participant ShortcutRunner
    participant Helper
    participant MultitaskView
    participant LockScreen

    User->>ShortcutRunner: Super+L (ShortcutAction::Lockscreen)
    ShortcutRunner->>Helper: showLockScreen()
    alt currentMode == Normal or Multitaskview
        opt currentMode == Multitaskview and m_multitaskView
            Helper->>MultitaskView: immediatelyExit()
            Helper->>Helper: deleteTaskSwitch()
        end
        Helper->>Helper: setCurrentMode(LockScreen)
        Helper->>LockScreen: lock()
        Helper->>Helper: setWorkspaceVisible(false)
    else other modes
        ShortcutRunner-->>User: [lockscreen ignored]
    end
Loading

File-Level Changes

Change Details Files
Allow lockscreen and shutdown shortcuts to trigger from Multitaskview mode in the shortcut runner.
  • Relaxed mode checks for lockscreen shortcut to accept both Normal and Multitaskview modes.
  • Relaxed mode checks for shutdown menu shortcut to accept both Normal and Multitaskview modes.
  • Ensured that invoking the shutdown menu from Multitaskview exits multitask view via immediatelyExit and clears task switch state before entering LockScreen mode and hiding the workspace.
src/modules/shortcut/shortcutrunner.cpp
Extend lockscreen D-Bus callbacks to function from Multitaskview mode and cleanly exit multitask view before locking or shutting down.
  • Relaxed mode checks in shutdown, lock, and switchUser callbacks to accept Normal and Multitaskview modes.
  • On valid lockscreen requests, immediately exit multitask view if present and delete task-switch state before switching to LockScreen mode.
  • Maintain existing behavior of setting lockscreen mode and hiding the workspace after initiating shutdown, lock, or switchUser actions.
src/seat/helper.cpp

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

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-wm

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

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.

2 participants