fix titlebar context menu pointer lock
This commit is contained in:
@@ -12,6 +12,11 @@ function TitleBar({ appName }: TitleBarProps): React.JSX.Element {
|
||||
const handleMaximize = (): void => window.electron.ipcRenderer.send('window-maximize')
|
||||
const handleClose = (): void => setShowCloseConfirm(true)
|
||||
const handleConfirmClose = (): void => window.electron.ipcRenderer.send('window-close')
|
||||
const suppressTitlebarContextMenu = (event: React.MouseEvent): void => {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
|
||||
const winBtn =
|
||||
'flex h-[20px] w-[20px] items-center justify-center text-white/50 hover:text-white transition cursor-pointer'
|
||||
@@ -21,6 +26,10 @@ function TitleBar({ appName }: TitleBarProps): React.JSX.Element {
|
||||
<div
|
||||
className="flex h-[38px] shrink-0 items-center justify-between border-b border-white/10 bg-[#111520] px-4 pl-5 select-none"
|
||||
style={{ WebkitAppRegion: 'drag' } as React.CSSProperties}
|
||||
onContextMenu={suppressTitlebarContextMenu}
|
||||
onMouseDown={(event) => {
|
||||
if (event.button === 2) suppressTitlebarContextMenu(event)
|
||||
}}
|
||||
>
|
||||
{/* 좌측 */}
|
||||
<div className="flex items-center">
|
||||
|
||||
Reference in New Issue
Block a user