summaryrefslogtreecommitdiffstats
path: root/src/tk/radio.c
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-08-06 09:31:42 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-08-06 09:31:42 (EDT)
commitf6b656b1f211769b71ad1ddb1ae6c22f76ef7cdc (patch)
tree400243e9f7c383bb8835b1695e472daf09d535ba /src/tk/radio.c
parent4693d1d70855b97d57cdbe92552ba304362fb453 (diff)
downloadmazefight-f6b656b1f211769b71ad1ddb1ae6c22f76ef7cdc.zip
mazefight-f6b656b1f211769b71ad1ddb1ae6c22f76ef7cdc.tar.gz
mazefight-f6b656b1f211769b71ad1ddb1ae6c22f76ef7cdc.tar.bz2
tk: Fix crash on focusing nested focusable widgets
Diffstat (limited to 'src/tk/radio.c')
-rw-r--r--src/tk/radio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tk/radio.c b/src/tk/radio.c
index 6f767af..2c75406 100644
--- a/src/tk/radio.c
+++ b/src/tk/radio.c
@@ -79,13 +79,14 @@ _mftk_radio_event(struct mftk_widget *w, SDL_Event *e, int x, int y)
case SDL_MOUSEBUTTONUP:
if (e->button.button == SDL_BUTTON_LEFT) {
mftk_window_focus(w->window, w);
+ return mftk_widget_event(r->grid, e, x, y);
}
break;
default:
break;
}
- return mftk_widget_event(r->grid, e, x, y);
+ return 0;
}
static int
@@ -155,6 +156,7 @@ mftk_radio_new(int butn_width, int butn_padding, SDL_Color *butn_color,
return NULL;
}
mftk_check_set_shape(r->children[i], MFTK_CHECK_SHAPE_CIR);
+ mftk_check_set_steals_focus(r->children[i], SDL_FALSE);
r->states[i].r = r;
r->states[i].state = i;
}