Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/13878

Vanessab222fdfac38b
diff --git a/app/src/layout/Tab.ts b/app/src/layout/Tab.ts
index 237fb0a91a..b6208b70cc 100644
--- a/app/src/layout/Tab.ts
+++ b/app/src/layout/Tab.ts
@@ -8,7 +8,7 @@ import {escapeGreat, escapeHtml} from "../util/escape";
import {unicode2Emoji} from "../emoji";
import {fetchPost} from "../util/fetch";
import {hideTooltip, showTooltip} from "../dialog/tooltip";
-import {isTouchDevice} from "../util/functions";
+import {isTouchDevice, isWindow} from "../util/functions";
/// #if !BROWSER
import {openNewWindow} from "../window/openNewWindow";
import {ipcRenderer} from "electron";
@@ -99,6 +99,9 @@ export class Tab {
tabElement.style.opacity = "0.38";
window.siyuan.dragElement = this.headElement;
}
+ if (isWindow() && this.headElement.getBoundingClientRect().top <= 0) {
+ ((this.headElement.parentElement.parentElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement).style as CSSStyleDeclarationElectron).WebkitAppRegion = "";
+ }
});
this.headElement.addEventListener("dragend", (event: DragEvent & { target: HTMLElement }) => {
const tabElement = hasClosestByTag(event.target, "LI");
@@ -136,6 +139,9 @@ export class Tab {
}
});
}
+ if (isWindow() && this.headElement.getBoundingClientRect().top <= 0) {
+ ((this.headElement.parentElement.parentElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement).style as CSSStyleDeclarationElectron).WebkitAppRegion = "drag";
+ }
});
}
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 1e0934553f..003c67c52e 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -231,7 +231,6 @@ export class Wnd {
}
}
});
-
this.headersElement.parentElement.addEventListener("drop", function (event: DragEvent & {
target: HTMLElement
}) {
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 92eead7ca2..d46efd65b4 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -124,6 +124,10 @@ declare namespace CSS {
const highlights: Map<string, Highlight>;
}
+interface CSSStyleDeclarationElectron extends CSSStyleDeclaration {
+ WebkitAppRegion: string
+}
+
interface Window {
echarts: {
init(element: HTMLElement, theme?: string, options?: {
diff --git a/app/src/window/setHeader.ts b/app/src/window/setHeader.ts
index 19cc5a6af9..cfeae50cc0 100644
--- a/app/src/window/setHeader.ts
+++ b/app/src/window/setHeader.ts
@@ -18,11 +18,9 @@ export const setTabPosition = () => {
const dragElement = headerElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement;
if (rect.top <= 0) {
dragElement.style.height = dragElement.parentElement.clientHeight + "px";
- // @ts-ignore
- dragElement.style.WebkitAppRegion = "drag";
+ (dragElement.style as CSSStyleDeclarationElectron).WebkitAppRegion = "drag";
} else {
- // @ts-ignore
- dragElement.style.WebkitAppRegion = "";
+ (dragElement.style as CSSStyleDeclarationElectron).WebkitAppRegion = "";
}
const headersLastElement = headerElement.lastElementChild as HTMLElement;
if ("darwin" === window.siyuan.config.system.os) {