Skip to content

fix: 三指滑动,最大化和恢复窗口分开设置#754

Closed
fly602 wants to merge 1 commit intolinuxdeepin:masterfrom
fly602:fix-302527(gesture)
Closed

fix: 三指滑动,最大化和恢复窗口分开设置#754
fly602 wants to merge 1 commit intolinuxdeepin:masterfrom
fly602:fix-302527(gesture)

Conversation

@fly602
Copy link
Contributor

@fly602 fly602 commented Mar 11, 2025

最大化和恢复窗口,窗管是一个接口,使用x11重写这块逻辑,目前存在问题:左右分屏,不能恢复窗管

Log: 三指滑动,最大化和恢复窗口分开设置
pms: BUG-302527

最大化和恢复窗口,窗管是一个接口,使用x11重写这块逻辑,目前存在问题:左右分屏,不能恢复窗管

Log: 三指滑动,最大化和恢复窗口分开设置
pms: BUG-302527
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602

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-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. manager.go文件中,添加了对flag.Lookup("test.v")的检查,以避免在单元测试中执行调试逻辑。这是一个好的做法,可以避免在测试时输出不必要的调试信息。

  2. gesture_action.go文件中,doToggleMaximize函数被修改为调用setActiveWindowMaxMin(true),而doToggleRestore函数被添加来处理窗口恢复。这种设计使得窗口的最大化和恢复逻辑更加清晰和模块化。

  3. utils.go文件中,setActiveWindowMaxMin函数被添加来处理窗口的最大化和恢复。这个函数首先获取当前焦点窗口的状态,然后根据max参数决定是添加还是移除最大化的状态。这是一个合理的实现,但是需要注意以下几点:

    • xconn变量在函数内部被使用,但是没有在函数参数中声明。这可能会导致xconn变量在函数调用时未定义。
    • ewmh.WMStateActionewmh.WMStateAddewmh.WMStateRemove等常量在函数中直接使用,但是没有在函数参数中声明。这可能会导致这些常量在函数调用时未定义。
    • logger.Warningf函数在窗口未聚焦时输出警告信息。这可能不是最佳的做法,因为警告信息可能会掩盖其他更重要的错误信息。
  4. utils.go文件中,setActiveWindowMaxMin函数的返回类型是void,但是在函数的最后有一个return语句。这可能会导致编译错误,因为函数的返回类型应该是error

  5. utils.go文件中,setActiveWindowMaxMin函数中的err变量在函数中被多次赋值,但是只有最后一次赋值被使用。这可能会导致代码的可读性降低,建议将err变量合并为一个。

  6. utils.go文件中,setActiveWindowMaxMin函数中的focusAtomvertAtomhorzAtom变量在函数中被多次使用,但是每次使用时都需要重新获取。这可能会导致性能问题,建议将这些变量提取到函数外部,并在函数开始时一次性获取。

总体来说,代码的修改和添加是合理的,但是需要注意一些细节问题,以提高代码的可读性、可维护性和性能。

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Mar 13, 2025

TAG Bot

New tag: 6.1.24
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #757

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Mar 27, 2025

TAG Bot

New tag: 6.1.25
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #760

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Apr 2, 2025

TAG Bot

New tag: 6.1.26
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #763

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Apr 17, 2025

TAG Bot

New tag: 6.1.27
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #767

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Apr 22, 2025

TAG Bot

New tag: 6.1.28
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #769

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Apr 29, 2025

TAG Bot

New tag: 6.1.29
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #775

@deepin-bot
Copy link
Contributor

deepin-bot bot commented May 8, 2025

TAG Bot

New tag: 6.1.30
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #780

@deepin-bot
Copy link
Contributor

deepin-bot bot commented May 13, 2025

TAG Bot

New tag: 6.1.31
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #784

@deepin-bot
Copy link
Contributor

deepin-bot bot commented May 13, 2025

TAG Bot

New tag: 6.1.32
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #786

@deepin-bot
Copy link
Contributor

deepin-bot bot commented May 27, 2025

TAG Bot

New tag: 6.1.33
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #793

@fly602 fly602 closed this Jun 4, 2025
@fly602 fly602 deleted the fix-302527(gesture) branch June 4, 2025 06:02
@fly602 fly602 restored the fix-302527(gesture) branch June 4, 2025 06:02
@fly602 fly602 deleted the fix-302527(gesture) branch August 25, 2025 07:57
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