Skip to content

Commit a19b3e1

Browse files
committed
Fix issue with window anomalies on Win11
1 parent b30e8d4 commit a19b3e1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Www/ts/MainWindow/MainWindow.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ export class MainWindow {
228228
if (windowState === "Maximized" && _fullScreen.getEnabled() === false) {
229229
baseWindow.normal();
230230
} else {
231-
setTimeout(() => {
231+
setTimeout(() => { // 直接全螢幕會與視窗拖曳衝突,所以加入延遲
232232
baseWindow.maximized();
233-
}, 50);
233+
}, 150);
234234
}
235235
});
236236
Lib.addEventDblclick(_fileShow.iframes.welcomeview.dom, async () => { // 歡迎頁面
@@ -240,12 +240,12 @@ export class MainWindow {
240240
} else {
241241
setTimeout(() => {
242242
baseWindow.maximized();
243-
}, 50);
243+
}, 150);
244244
}
245245
});
246246

247247
// 讓工具列允許拖曳視窗
248-
_domToolbar.addEventListener("mousedown", async (e) => {
248+
Lib.addDragThresholdListener(_domToolbar, 1, async (e) => { // 移動一定距離後觸發
249249
if (_fullScreen.getEnabled() === true) { return; }
250250
const dom = e.target as HTMLDivElement;
251251
if (dom) {

Www/ts/SettingWindow/SettingWindow.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ class SettingWindow {
8989

9090
// 拖曳視窗
9191
const domLeftBox = getDom("#window-left .pagetab") as HTMLElement;
92-
domLeftBox.addEventListener("mousedown", async (e) => {
93-
92+
Lib.addDragThresholdListener(domLeftBox, 1, async (e) => { // 移動一定距離後觸發
9493
// 如果有滾動條,就禁止拖曳(避免無法點擊滾動條)
9594
if (Lib.isScrollbarVisible(domLeftBox)) { return; }
9695

0 commit comments

Comments
 (0)