fix: 修复搜索模式下窗口关闭按钮失效的问题#1751
Closed
makoMakoGo wants to merge 1 commit intochen08209:mainfrom
Closed
Conversation
Fixes #1574 When the search box is active, SystemBackBlock sets backBlock=true to prevent accidental exit via system back button. However, this also blocked the explicit window close button. Added a `force` parameter to handleBackOrExit(). When force=true (used by window close button and system close events), the backBlock check is bypassed, allowing the window to close properly.
Author
|
已编译验证后在Windows上验证过,验证截图由另一外用户上传 |
Author
|
@chen08209 看一下,困扰我朋友很久的bug |
|
@makoMakoGo 这个问题依旧存在,为什么要关闭这个PR? |
Author
你看下contributors列表,这作者从不审 pr 也不合并 pr,趁早换项目用吧 |
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
关联 Issue
Fixes #1574
问题描述
在连接面板、代理面板、请求面板进行搜索后,如果不关闭搜索框,窗口的关闭按钮会失效。
原因分析
当进入搜索模式时,
SystemBackBlock会设置backBlock = true,目的是防止用户通过系统返回键意外退出搜索/编辑模式。但
handleBackOrExit()函数会检查这个标志,导致所有关闭操作都被阻止,包括用户显式点击的关闭按钮。修复方案
为
handleBackOrExit()添加force参数:force = false(默认):保持原有行为,系统返回键/快捷键会先退出搜索模式force = true:跳过backBlock检查,允许直接关闭窗口窗口关闭按钮和系统窗口关闭事件使用
force: true,确保用户的显式关闭意图能被执行。改动文件
lib/controller.dart:添加force参数lib/manager/window_manager.dart:关闭按钮和onWindowClose事件使用force: true测试
已在 Windows 11 上测试通过: