From f6b656b1f211769b71ad1ddb1ae6c22f76ef7cdc Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 06 Aug 2021 09:31:42 -0400 Subject: tk: Fix crash on focusing nested focusable widgets --- (limited to 'src/tk/radio.c') 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; } -- cgit v0.9.1