Skip to content

Commit

Permalink
Fix: #45 Windows right-click menu to view source code crash issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sxmxta committed Nov 8, 2024
1 parent 65a8f26 commit bf48714
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cef/browser_window_hook_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package cef

import (
"github.com/energye/energy/v2/cef/winapi"
"github.com/energye/energy/v2/consts"
"github.com/energye/energy/v2/types"
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/types/messages"
Expand Down Expand Up @@ -74,6 +75,10 @@ func (m *LCLBrowserWindow) wndProc(hwnd types.HWND, message uint32, wParam, lPar
}

func (m *LCLBrowserWindow) _HookWndProcMessage() {
switch m.WindowType() {
case consts.WT_DEV_TOOLS, consts.WT_VIEW_SOURCE:
return
}
wndProcCallback := syscall.NewCallback(m.wndProc)
m.oldWndPrc = win.SetWindowLongPtr(m.Handle(), win.GWL_WNDPROC, wndProcCallback)
}
Expand Down

0 comments on commit bf48714

Please sign in to comment.