fix(v3): add nil check to Focus() to prevent SIGSEGV after Hide (#4922)

* fix(v3): add nil check to Focus() to prevent SIGSEGV after Hide

The Focus() method was missing a nil/destroyed check on w.impl,
causing a SIGSEGV when Focus() is called on a window that has been
hidden and potentially destroyed (e.g., when clicking the dock icon
after hiding the window on macOS).

This aligns Focus() with Show() and Hide() which already have proper
guards against nil/destroyed window implementations.

Fixes #4890

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add changelog entry for Focus() nil check fix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: ddmoney420 <ddmoney420@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
ddmoney420 2026-02-02 03:10:36 -07:00 committed by GitHub
commit a572244e62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,11 +25,11 @@ After processing, the content will be moved to the main changelog and this file
## Fixed
<!-- Bug fixes -->
- Fix SIGSEGV crash when calling `Focus()` on a hidden or destroyed window (#4890) by @ddmoney420
- Fix potential panic when setting empty icon or bitmap on Linux (#4923) by @ddmoney420
- Fix ErrorDialog crash when called from service binding on macOS (#3631) by @leaanthony
- Make menus to be displayed on Windows OS in `v3\examples\dialogs` by @ndianabasi
- Fix race condition causing TypeError during page reload (#4872) by @ddmoney420
- Fix incorrect output from binding generator tests by removing global state in the `Collector.IsVoidAlias()` method (#4941) by @fbbdev
## Deprecated