fix titlebar context menu pointer lock

This commit is contained in:
2026-07-03 10:20:17 +09:00
parent b29540bee5
commit 5c4426206e
+9
View File
@@ -12,6 +12,11 @@ function TitleBar({ appName }: TitleBarProps): React.JSX.Element {
const handleMaximize = (): void => window.electron.ipcRenderer.send('window-maximize') const handleMaximize = (): void => window.electron.ipcRenderer.send('window-maximize')
const handleClose = (): void => setShowCloseConfirm(true) const handleClose = (): void => setShowCloseConfirm(true)
const handleConfirmClose = (): void => window.electron.ipcRenderer.send('window-close') const handleConfirmClose = (): void => window.electron.ipcRenderer.send('window-close')
const suppressTitlebarContextMenu = (event: React.MouseEvent): void => {
event.preventDefault()
event.stopPropagation()
}
const winBtn = const winBtn =
'flex h-[20px] w-[20px] items-center justify-center text-white/50 hover:text-white transition cursor-pointer' '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 <div
className="flex h-[38px] shrink-0 items-center justify-between border-b border-white/10 bg-[#111520] px-4 pl-5 select-none" 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} style={{ WebkitAppRegion: 'drag' } as React.CSSProperties}
onContextMenu={suppressTitlebarContextMenu}
onMouseDown={(event) => {
if (event.button === 2) suppressTitlebarContextMenu(event)
}}
> >
{/* 좌측 */} {/* 좌측 */}
<div className="flex items-center"> <div className="flex items-center">