Navigation Menu

Skip to content

Commit

Permalink
Fix bug introduced in db77afa
Browse files Browse the repository at this point in the history
  • Loading branch information
lxn committed Aug 10, 2015
1 parent 33f7f41 commit 9481b0d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions window.go
Expand Up @@ -1278,6 +1278,8 @@ func (wb *WindowBase) handleKeyUp(wParam, lParam uintptr) {
// When implementing your own WndProc to add or modify behavior, call the
// WndProc of the embedded window for messages you don't handle yourself.
func (wb *WindowBase) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr {
window := windowFromHandle(hwnd)

switch msg {
case win.WM_ERASEBKGND:
if wb.background == nil {
Expand Down Expand Up @@ -1376,8 +1378,10 @@ func (wb *WindowBase) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr)
wb.hWnd = 0
}

if wb.origWndProcPtr != 0 {
return win.CallWindowProc(wb.origWndProcPtr, hwnd, msg, wParam, lParam)
if window != nil {
if wndProc := window.AsWindowBase().origWndProcPtr; wndProc != 0 {
return win.CallWindowProc(wndProc, hwnd, msg, wParam, lParam)
}
}

return win.DefWindowProc(hwnd, msg, wParam, lParam)
Expand Down

0 comments on commit 9481b0d

Please sign in to comment.