From f8ed3afd0646b4e4d48eb82cd2afb67846d0b854 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Sat, 11 Jan 2025 23:50:58 +0100 Subject: [PATCH] Don't ignore first popup message (Klipper) --- CYD-Klipper/src/core/printer_integration.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CYD-Klipper/src/core/printer_integration.cpp b/CYD-Klipper/src/core/printer_integration.cpp index a76ae38..0ee304f 100644 --- a/CYD-Klipper/src/core/printer_integration.cpp +++ b/CYD-Klipper/src/core/printer_integration.cpp @@ -62,11 +62,18 @@ PrinterData* BasePrinter::AnnouncePrinterData() lv_msg_send(DATA_PRINTER_STATE, get_current_printer()); } - if (old_popup_message != printer_data_copy->popup_message && old_popup_message != NULL && old_popup_message != blank && !no_free) + if (old_popup_message != printer_data_copy->popup_message) { - LOG_F(("Freeing popup message '%s' (%x)\n", old_popup_message, old_popup_message)); - free(old_popup_message); - lv_msg_send(DATA_PRINTER_POPUP, get_current_printer()); + if (old_popup_message != NULL && old_popup_message != blank && !no_free) + { + LOG_F(("Freeing popup message '%s' (%x)\n", old_popup_message, old_popup_message)); + free(old_popup_message); + } + + if (printer_data_copy->popup_message != NULL && printer_data_copy->popup_message != blank) + { + lv_msg_send(DATA_PRINTER_POPUP, get_current_printer()); + } } lv_msg_send(DATA_PRINTER_DATA, get_current_printer());