Skip to content

fix(shortcut): update desktop switching shortcuts to use Meta key#389

Open
Shining-N wants to merge 1 commit into
linuxdeepin:masterfrom
Shining-N:master
Open

fix(shortcut): update desktop switching shortcuts to use Meta key#389
Shining-N wants to merge 1 commit into
linuxdeepin:masterfrom
Shining-N:master

Conversation

@Shining-N

@Shining-N Shining-N commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Change desktop switching shortcuts from Ctrl+Alt to Meta key for better usability. Remove Meta+Left/Right from window quick tile to avoid shortcut conflicts.

更新桌面切换快捷键为Meta键组合,取消窗口快速铺至
左右侧的Meta快捷键绑定,避免快捷键冲突。

Log: 更新桌面切换快捷键绑定
PMS: BUG-313691
Influence: 桌面切换快捷键改为Meta+数字或Meta+方向键,取消窗口左右快速铺的Meta快捷键绑定

Summary by Sourcery

Update global desktop switching shortcuts to use Meta key combinations and resolve conflicts with window tiling shortcuts.

Bug Fixes:

  • Resolve shortcut conflicts between desktop switching and window quick-tiling by adjusting their key bindings.

Enhancements:

  • Change desktop switching shortcuts from Ctrl+Alt combinations to Meta+number and Meta+arrow key combinations for improved usability.

Change desktop switching shortcuts from Ctrl+Alt to Meta key for
better usability. Remove Meta+Left/Right from window quick tile
to avoid shortcut conflicts.

更新桌面切换快捷键为Meta键组合,取消窗口快速铺至
左右侧的Meta快捷键绑定,避免快捷键冲突。

Log: 更新桌面切换快捷键绑定
PMS: BUG-313691
Influence: 桌面切换快捷键改为Meta+数字或Meta+方向键,取消窗口左右快速铺的Meta快捷键绑定
@github-actions

Copy link
Copy Markdown

CLA Assistant Lite bot:
提交邮箱中包含我们的合作伙伴,但您似乎并非合作伙伴的成员或对接人,请联系相关对接人将您添加至组织之中,或由其重新发起 Pull Request。
The commit email domain belongs to one of our partners, but it seems you are not yet a member of the current organization, please contact the contact person to add you to the organization or let them submit the Pull Request.

You can retrigger this bot by commenting recheck in this Pull Request

@sourcery-ai

sourcery-ai Bot commented Apr 28, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates desktop switching global shortcuts to use Meta-based key combinations and removes conflicting Meta+Left/Right bindings from window quick-tiling actions to resolve shortcut conflicts and improve usability.

File-Level Changes

Change Details Files
Retarget virtual desktop switching shortcuts from Ctrl+Alt to Meta and clean up conflicting Meta+Left/Right bindings for window tiling.
  • Change desktop switching shortcuts to Meta+number combinations instead of Ctrl+Alt+number.
  • Change desktop switching shortcuts to Meta+arrow key combinations instead of Ctrl+Alt+arrow keys.
  • Remove Meta+Left and Meta+Right bindings from window quick-tile left/right actions to avoid shortcut conflicts.
  • Ensure the kglobalshortcuts configuration reflects the new Meta-based bindings consistently for all relevant actions.
configures/kglobalshortcutsrc

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


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
Copy Markdown

deepin pr auto review

这段代码是一个 KDE Plasma 桌面环境的全局快捷键配置文件(kglobalshortcutsrc)的 diff 差异对比。它主要修改了窗口管理和桌面切换的快捷键绑定。

以下是对该 diff 的审查意见,分为语法逻辑、代码质量、代码性能和代码安全四个方面:

1. 语法逻辑

  • 格式规范:配置文件的格式符合 KDE 的 INI 风格配置文件标准。每一行通常遵循 Key=Default,Alternate,Name 的格式。
  • 转义字符:在 Switch to Desktop 1 等行中,使用了 \t 来分隔两个备选快捷键(例如 Meta+1\tMeta+Num+1)。这是正确的语法,表示在默认快捷键中提供了两种变体(主键盘数字和数字小键盘数字)。
  • 逻辑一致性
    • 修改点:将桌面切换(Switch to Desktop 1-6)和桌面导航(Switch to Next/Previous Desktop)的快捷键从 Ctrl+Alt 组合修改为了 Meta(即 Windows/Command 键)组合。
    • 逻辑问题:存在不一致的情况。
      • 桌面 7-9 原本就是 Meta+7/8/9,现在 1-6 也改成了 Meta+1/2/3...,这使得桌面 1-9 的切换逻辑变得统一,这是好的。
      • 但是Window Quick Tile LeftWindow Quick Tile Right(窗口快速平铺)原本绑定的是 Meta+LeftMeta+Right,现在被改成了 none(禁用)。
      • 冲突隐患Switch to Next Desktop 现在绑定了 Meta+Right,而 Switch to Previous Desktop 绑定了 Meta+Left。这意味着用户无法再使用 Meta+Left/Right 来快速平铺窗口,因为这两个键位已经被桌面切换功能占用了。如果用户习惯使用 Meta 键配合方向键进行窗口管理,这会造成功能冲突或丢失。

2. 代码质量

  • 可读性:配置项清晰,注释(中文名称)准确描述了功能,质量良好。
  • 维护性
    • 将桌面切换统一为 Meta + 数字 符合现代桌面环境(如 macOS、Windows 10/11 虚拟桌面)的常见习惯,提高了用户在不同系统间切换的适应性,降低了学习成本。
    • 移除 Window Quick Tile Left/Right 的快捷键可能是为了解决上述冲突,但这牺牲了窗口管理的便捷性。

3. 代码性能

  • 性能影响:配置文件的修改仅涉及键值对的字符串替换,对运行时性能的影响微乎其微。KDE 在读取配置时,哈希查找这些键的效率不会因为键值内容的变化而改变。

4. 代码安全

  • 安全性:此修改仅涉及用户界面的快捷键映射,不涉及系统权限、文件路径操作或外部命令执行,因此不存在安全漏洞或风险。

改进建议

基于上述审查,主要的改进方向在于解决快捷键冲突优化用户体验

  1. 解决冲突(重要)

    • 现状Meta+Left/Right 目前被分配给了"切换到上一个/下一个桌面",导致"窗口快速平铺左/右"功能失效。
    • 建议:建议为"窗口快速平铺"功能寻找替代键位,或者修改桌面切换的键位。
    • 方案 A:保留 Meta+Left/Right 用于窗口平铺,将桌面切换改为 Ctrl+Meta+Left/Right
    • 方案 B:保留 Meta+Left/Right 用于桌面切换,将窗口平铺改为 Meta+Ctrl+Left/Right 或其他组合(如 Meta+Home/End)。
  2. 统一性检查

    • 检查 Switch Window Left/Right/Up/Down(切换窗口焦点)目前使用的是 Meta+Alt+Direction。既然桌面切换已经简化为 Meta+Number,建议评估是否需要调整窗口切换的快捷键,以保持逻辑上的简洁(例如是否可以只用 Meta+Direction 切换窗口,但这会与上述平铺功能冲突,需权衡)。
  3. 功能恢复

    • 当前 diff 中 Window Quick Tile LeftWindow Quick Tile Right 被设为 none。如果这是为了解决冲突而临时禁用,建议在 diff 中明确分配新的快捷键,而不是直接留空,以免导致功能缺失。

修改后的建议示例(解决冲突):

如果决定优先保留桌面切换的 Meta+Left/Right,建议同时恢复窗口平铺功能,例如修改为使用 Ctrl 修饰符:

-Window Quick Tile Left=none,none,将窗口快速铺至左侧
-Window Quick Tile Right=none,none,将窗口快速铺至右侧
+Window Quick Tile Left=Meta+Ctrl+Left,none,将窗口快速铺至左侧
+Window Quick Tile Right=Meta+Ctrl+Right,none,将窗口快速铺至右侧

或者,如果决定优先保留窗口平铺的 Meta+Left/Right,则应修改桌面切换:

-Switch to Next Desktop=Meta+Right,none,切换到下一个桌面
-Switch to Previous Desktop=Meta+Left,none,切换到上一个桌面
+Switch to Next Desktop=Meta+Ctrl+Right,none,切换到下一个桌面
+Switch to Previous Desktop=Meta+Ctrl+Left,none,切换到上一个桌面

总结:代码本身没有语法或安全问题,但存在逻辑上的功能冲突(快捷键覆盖),建议根据实际使用习惯重新分配 Meta+Left/Right 的归属,避免功能丢失。

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Groveer, justforlxz, Shining-N

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

@deepin-bot

deepin-bot Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.0.9
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #391

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.

4 participants