app/internal/windows: don't draw window background on Windows

Avoids flickering between GPU content and the CPU drawn background
color.

gofmt -w -s . now we're here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-11-06 17:28:14 +01:00
parent 9c84b95f7d
commit 7256bdae38
2 changed files with 7 additions and 3 deletions
+4
View File
@@ -116,6 +116,7 @@ const (
_WM_CREATE = 0x0001
_WM_DPICHANGED = 0x02E0
_WM_DESTROY = 0x0002
_WM_ERASEBKGND = 0x0014
_WM_KEYDOWN = 0x0100
_WM_KEYUP = 0x0101
_WM_LBUTTONDOWN = 0x0201
@@ -273,6 +274,9 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
case _WM_DPICHANGED:
// Let Windows know we're prepared for runtime DPI changes.
return 1
case _WM_ERASEBKGND:
// Avoid flickering between GPU content and background color.
return 1
case _WM_KEYDOWN, _WM_SYSKEYDOWN:
if n, ok := convertKeyCode(wParam); ok {
cmd := key.Event{Name: n}
+3 -3
View File
@@ -24,11 +24,11 @@ type Theme struct {
Hint color.RGBA
InvText color.RGBA
}
TextSize unit.Value
TextSize unit.Value
checkBoxCheckedIcon *Icon
checkBoxUncheckedIcon *Icon
radioCheckedIcon *Icon
radioUncheckedIcon *Icon
radioCheckedIcon *Icon
radioUncheckedIcon *Icon
}
func NewTheme() *Theme {