Vanessa 2025-03-28 13:45:55 +08:00
parent afead500fb
commit 6af0bf0ceb
2 changed files with 10 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import {hideTooltip, showTooltip} from "../dialog/tooltip";
import {isTouchDevice} from "../util/functions";
/// #if !BROWSER
import {openNewWindow} from "../window/openNewWindow";
import {ipcRenderer} from "electron";
/// #endif
import {layoutToJSON, saveLayout} from "./util";
@ -113,6 +114,7 @@ export class Tab {
if (document.body.contains(this.panelElement) &&
(event.clientX < 0 || event.clientY < 0 || event.clientX > window.innerWidth || event.clientY > window.innerHeight)) {
openNewWindow(this);
ipcRenderer.send(Constants.SIYUAN_SEND_WINDOWS, {cmd: "resetTabsStyle"});
}
}, Constants.TIMEOUT_LOAD); // 等待主进程发送关闭消息
/// #endif

View File

@ -14,6 +14,14 @@ export const onWindowsMsg = (ipcData: IWebSocketData) => {
case "closetab":
closeTab(ipcData);
break;
case "resetTabsStyle":
document.querySelectorAll(".layout-tab-bars--drag").forEach(item => {
item.classList.remove("layout-tab-bars--drag");
item.querySelectorAll(".layout-tab-bar li[data-clone='true']").forEach(tabItem => {
tabItem.remove();
});
});
break;
case "lockscreen":
exportLayout({
errorExit: false,