fix titlebar context menu pointer lock
This commit is contained in:
@@ -441,12 +441,21 @@ export default function TitleBar({ user, accessToken = '', onHelpClick, onOpenCo
|
||||
}
|
||||
|
||||
const handleConfirmClose = (): void => window.titlebar.close()
|
||||
const suppressTitlebarContextMenu = (event: React.MouseEvent): void => {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<header
|
||||
className="relative z-[10020] flex h-[38px] shrink-0 items-center justify-between rounded-t-[18px] bg-[#111520] px-3 pl-5"
|
||||
style={{ WebkitAppRegion: 'drag' } as React.CSSProperties}
|
||||
onContextMenu={suppressTitlebarContextMenu}
|
||||
onMouseDown={(event) => {
|
||||
if (event.button === 2) suppressTitlebarContextMenu(event)
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center gap-2.5">
|
||||
<img src={icon} alt="" className="h-[18px] w-auto opacity-90" />
|
||||
|
||||
Reference in New Issue
Block a user