diff --git a/CHANGELOG.md b/CHANGELOG.md index 8779e6c..7767107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ If a change only affects particular applications, they are listed in parentheses - feat(buffyboard): Add fbdev force-refresh quirk via config - feat(buffyboard): Allow disabling input devices via config - feat(buffyboard): Add CLI flags for overriding geometry & DPI +- fix(unl0kr): Shutdown message box doesn't close on decline - misc: Update lvgl to git master (2023-03-30) ## 3.0.0 (2024-03-22) diff --git a/unl0kr/main.c b/unl0kr/main.c index b1b11bb..91039ca 100644 --- a/unl0kr/main.c +++ b/unl0kr/main.c @@ -296,8 +296,18 @@ static void shutdown_mbox_confirmed_cb(lv_event_t *event) { } static void shutdown_mbox_declined_cb(lv_event_t *event) { - lv_obj_t *mbox = lv_event_get_target(event); - lv_msgbox_close(mbox); + // Find the containing message box for the clicked button + lv_obj_t *obj = lv_event_get_target(event); + while (obj && !lv_obj_check_type(obj, &lv_msgbox_class)) { + obj = lv_obj_get_parent(obj); + } + + if (!obj) { + bbx_log(BBX_LOG_LEVEL_ERROR, "Could not find containing message box for clicked button"); + return; + } + + lv_msgbox_close(obj); } static void keyboard_value_changed_cb(lv_event_t *event) {