diff --git a/main.go b/main.go index 6277026..127ae9d 100644 --- a/main.go +++ b/main.go @@ -1655,6 +1655,9 @@ func (u *ui) noteCurrentVaultPath() { } func (u *ui) layout(gtx layout.Context) layout.Dimensions { + // Clear the full frame explicitly so mobile surfaces don't start from an + // unpainted black buffer before nested background widgets run. + paint.Fill(gtx.Ops, bgColor) u.syncHostedAPI() u.filter() u.processShortcuts(gtx) diff --git a/main_test.go b/main_test.go index 1b2b6f3..123aa5a 100644 --- a/main_test.go +++ b/main_test.go @@ -30,6 +30,20 @@ import ( "git.julianfamily.org/keepassgo/webdav" ) +func TestMain(m *testing.M) { + stateDir, err := os.MkdirTemp("", "keepassgo-test-state-") + if err != nil { + panic(err) + } + if err := os.Setenv("KEEPASSGO_STATE_DIR", stateDir); err != nil { + _ = os.RemoveAll(stateDir) + panic(err) + } + code := m.Run() + _ = os.RemoveAll(stateDir) + os.Exit(code) +} + func TestUIFiltersUsingVaultModelPathsAndSearch(t *testing.T) { t.Parallel()