mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-13 21:02:10 +08:00
修复在勿扰模式下,使用快捷键启动项目和显示快速搜索窗口仍然生效的问题。
This commit is contained in:
parent
8c6de3fdc2
commit
6f04f8ccbd
@ -113,6 +113,15 @@ function showQuickSearchWindowBefore() {
|
||||
* 显示快速搜索窗口
|
||||
*/
|
||||
function showQuickSearchWindow() {
|
||||
// flag
|
||||
let flag = true;
|
||||
// 是否开启勿扰模式
|
||||
if (global.setting.general.notDisturb) {
|
||||
if (global.addon.isFullscreen()) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
// 获取鼠标所在的屏幕
|
||||
let currentDisplay = screen.getDisplayNearestPoint(
|
||||
screen.getCursorScreenPoint()
|
||||
@ -123,7 +132,8 @@ function showQuickSearchWindow() {
|
||||
// 代表窗口的位置不再任一屏幕内,将窗口位置移动到主窗口
|
||||
quickSearchWindow.center();
|
||||
} else if (
|
||||
(windowDisplay.length === 1 && currentDisplay.id !== windowDisplay[0].id) ||
|
||||
(windowDisplay.length === 1 &&
|
||||
currentDisplay.id !== windowDisplay[0].id) ||
|
||||
windowDisplay.length > 1
|
||||
) {
|
||||
// 在鼠标所在的屏幕显示
|
||||
@ -137,6 +147,9 @@ function showQuickSearchWindow() {
|
||||
}
|
||||
}
|
||||
// 显示
|
||||
quickSearchWindow.setBounds({ width: global.setting.quickSearch.width });
|
||||
quickSearchWindow.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -119,9 +119,19 @@ function setShortcutKey(setting: Setting = global.setting) {
|
||||
globalShortcut.register(
|
||||
item.shortcutKey.replace("Win", "Super"),
|
||||
() => {
|
||||
// flag
|
||||
let flag = true;
|
||||
// 是否开启勿扰模式
|
||||
if (global.setting.general.notDisturb) {
|
||||
if (global.addon.isFullscreen()) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
// 项目
|
||||
run("main", "open", item);
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
|
Loading…
Reference in New Issue
Block a user