fyne-io/fyne · error
implement me
Error message
implement me
What it means
noosWindow is the fake window behind fyne's embedded (offscreen) driver, which powers the public test package (test.NewWindow / test.NewDriver). Most of its methods are silent no-op stubs, but RequestFocus is one of the few that still panics 'implement me' - focusing a window has no meaning without an OS window manager, so it was never implemented.
Source
Thrown at internal/driver/embedded/window.go:35
func (w *noosWindow) SetTitle(s string) {
w.title = s
}
func (*noosWindow) FullScreen() bool {
return true
}
func (*noosWindow) SetFullScreen(_ bool) {
}
func (w *noosWindow) Resize(s fyne.Size) {
w.c.Resize(s)
}
func (*noosWindow) RequestFocus() {
// TODO implement me
panic("implement me")
}
func (*noosWindow) FixedSize() bool {
return true
}
func (*noosWindow) SetFixedSize(bool) {}
func (*noosWindow) CenterOnScreen() {}
func (w *noosWindow) Padded() bool {
return w.c.Padded()
}
func (w *noosWindow) SetPadded(pad bool) {
w.c.SetPadded(pad)
}
View on GitHub (pinned to 8860ee95c3)
Solutions
- Guard the focus call when running under the test/embedded driver (skip it or wrap with recover in test helpers)
- Move focus-dependent assertions to integration tests executed against the real desktop driver
- Contribute a no-op RequestFocus for the embedded driver upstream so test windows stop crashing
Example fix
// before (inside a unit test using fyne.io/fyne/v2/test)
w := test.NewWindow(entry)
w.RequestFocus() // embedded driver: panic "implement me"
// after
w := test.NewWindow(entry)
func() {
defer func() { _ = recover() }() // RequestFocus unimplemented offscreen
w.RequestFocus()
}() Defensive patterns
Strategy: try-catch
Try / catch
// Wrap focus calls that may run against the embedded/test driver.
func focusIfSupported(w fyne.Window) {
defer func() {
if r := recover(); r != nil {
// embedded driver has no RequestFocus; safe to ignore in tests
_ = r
}
}()
w.RequestFocus()
} Prevention
- Keep RequestFocus out of code paths shared by unit tests, or wrap it once in a guard helper
- Assert focus behavior in desktop-driver integration tests, not headless unit tests
- When adding new noosWindow methods to test flows, check the embedded driver for stubs first
When it happens
Trigger: Calling w.RequestFocus() (directly or through a focus-management helper) on a window created by test.NewWindow or any other embedded-driver window - typical in unit tests that exercise focus behavior.
Common situations: Widget/app tests that call production code which itself calls RequestFocus; shared helpers used by both the real app and the test suite; CI suites that only fail on headless test runs.
Related errors
- Run() or ShowAndRun() must be called from main goroutine
- toNativePtr() failed "%s": %s
- unhandled token type: %T %+v
- encountered empty values slice
- TODO only know how to handle DataIntDec type here
AI-assisted analysis of fyne-io/fyne@8860ee95c3 (2026-08-15).
Data as JSON: /api/errors/73e32a9f7d92e703.
Report an issue: GitHub.