Commit 4205c2e
committed
gfx: fix Graphics Widgets toggle wedging after the first use
The notification-toggle handler gated its gfx_widgets init/deinit on the
INITED flag, but the menu (and everything else) reads the *active* flag via
gfx_widgets_ready(). drivers_init() sets DISPGFX_WIDGET_FLAG_PERSISTING at
startup, so the handler's gfx_widgets_deinit(persisting) never called
gfx_widgets_free() and thus never cleared INITED. After the first toggle-off
INITED stayed set, so the next toggle-on failed its "!inited" guard, the init
branch never ran, active stayed false, and the menu stopped updating -- the
toggle worked exactly once.
Gate the state machine on p_dispwidget->active (the state the menu reads and
that the handler sets directly), and deinit with persisting=false so a real
user toggle-off fully tears down and a later toggle-on re-inits cleanly. The
double change_handler invocation per toggle is now idempotent too, since the
second pass sees the already-updated active state.
Compile-verified. This targets the specific "works once then stops" latch;
the runtime widget lifecycle still warrants an on-device confirmation.
Signed-off-by: LibretroAdmin <LibretroAdmin@users.noreply.github.com>1 parent bacf70d commit 4205c2e
1 file changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3979 | 3979 | | |
3980 | 3980 | | |
3981 | 3981 | | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
3982 | 3986 | | |
3983 | | - | |
3984 | | - | |
| 3987 | + | |
3985 | 3988 | | |
3986 | 3989 | | |
3987 | 3990 | | |
| |||
3990 | 3993 | | |
3991 | 3994 | | |
3992 | 3995 | | |
3993 | | - | |
| 3996 | + | |
3994 | 3997 | | |
3995 | 3998 | | |
3996 | 3999 | | |
| |||
4008 | 4011 | | |
4009 | 4012 | | |
4010 | 4013 | | |
4011 | | - | |
| 4014 | + | |
4012 | 4015 | | |
4013 | 4016 | | |
4014 | 4017 | | |
| |||
4017 | 4020 | | |
4018 | 4021 | | |
4019 | 4022 | | |
4020 | | - | |
4021 | | - | |
| 4023 | + | |
| 4024 | + | |
| 4025 | + | |
4022 | 4026 | | |
4023 | 4027 | | |
4024 | 4028 | | |
| |||
0 commit comments