app: added windows.TRUE for Windows

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2021-01-27 17:59:21 +01:00
committed by Elias Naur
parent f7d1f46c1f
commit d604455582
2 changed files with 7 additions and 5 deletions
+5 -5
View File
@@ -229,7 +229,7 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
case windows.WM_UNICHAR: case windows.WM_UNICHAR:
if wParam == windows.UNICODE_NOCHAR { if wParam == windows.UNICODE_NOCHAR {
// Tell the system that we accept WM_UNICHAR messages. // Tell the system that we accept WM_UNICHAR messages.
return 1 return windows.TRUE
} }
fallthrough fallthrough
case windows.WM_CHAR: case windows.WM_CHAR:
@@ -237,13 +237,13 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
w.w.Event(key.EditEvent{Text: string(r)}) w.w.Event(key.EditEvent{Text: string(r)})
} }
// The message is processed. // The message is processed.
return 1 return windows.TRUE
case windows.WM_DPICHANGED: case windows.WM_DPICHANGED:
// Let Windows know we're prepared for runtime DPI changes. // Let Windows know we're prepared for runtime DPI changes.
return 1 return windows.TRUE
case windows.WM_ERASEBKGND: case windows.WM_ERASEBKGND:
// Avoid flickering between GPU content and background color. // Avoid flickering between GPU content and background color.
return 1 return windows.TRUE
case windows.WM_KEYDOWN, windows.WM_KEYUP, windows.WM_SYSKEYDOWN, windows.WM_SYSKEYUP: case windows.WM_KEYDOWN, windows.WM_KEYUP, windows.WM_SYSKEYDOWN, windows.WM_SYSKEYUP:
if n, ok := convertKeyCode(wParam); ok { if n, ok := convertKeyCode(wParam); ok {
e := key.Event{ e := key.Event{
@@ -321,7 +321,7 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
case _WM_CURSOR: case _WM_CURSOR:
if w.cursorIn { if w.cursorIn {
windows.SetCursor(w.cursor) windows.SetCursor(w.cursor)
return 1 return windows.TRUE
} }
} }
+2
View File
@@ -55,6 +55,8 @@ type MinMaxInfo struct {
} }
const ( const (
TRUE = 1
CS_HREDRAW = 0x0002 CS_HREDRAW = 0x0002
CS_VREDRAW = 0x0001 CS_VREDRAW = 0x0001
CS_OWNDC = 0x0020 CS_OWNDC = 0x0020