Skip to content

Commit

Permalink
fix: 修复鼠标拖出窗口后触发上下文菜单的问题 (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
zty012 authored Jan 24, 2025
2 parents 88c0273 + 8e890a2 commit f10a11c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ export default function App() {
});
}
});
// 修复鼠标拖出窗口后触发上下文菜单的问题
window.addEventListener("contextmenu", (event) => {
console.log(event, window.screen);
if (
event.clientX < 0 ||
event.clientX > window.innerWidth ||
event.clientY < 0 ||
event.clientY > window.innerHeight
)
event.preventDefault();
});
Settings.get("useNativeTitleBar").then((useNativeTitleBar) => {
setUseNativeTitleBar(useNativeTitleBar);
if (useNativeTitleBar) {
Expand Down

0 comments on commit f10a11c

Please sign in to comment.