From 39ac19f7c8a61451ce386d386c87182415d62eab Mon Sep 17 00:00:00 2001 From: Wehrwolfmann <256216494+wehrwolfmann@users.noreply.github.com> Date: Sat, 22 Aug 2026 23:58:01 +0200 Subject: [PATCH] Keep Qt's own message dialogs on Plasma On Plasma our message boxes go through KDEPlatformMessageDialogHelper. It creates its own QMessageBox, sets Qt::WA_DeleteOnClose on it and keeps a raw pointer to it. QDialog::exec() deletes that dialog when it closes, so the helper is left with a dangling pointer; the later hide() call from ~QMessageBox dereferences freed memory and kills the app with SIGSEGV. The defect is in plasma-integration, but every QMessageBox in the app is exposed to it, so keep Qt's own dialogs instead. Nothing changes visually - the "native" Plasma dialog is a QMessageBox as well. Measured with the patch: 10 About/License cycles under a debugger, zero helper dialogs created and zero setNativeDialogVisible calls. Without it the helper dialog is created and destroyed before our own box on every click. --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index bd9fb40..a1b964a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -138,6 +138,12 @@ auto main(int argc, char** argv) -> std::int32_t { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif + // Keep using Qt's own dialogs. The Plasma platform theme creates a helper QMessageBox + // for every native message dialog, marks it WA_DeleteOnClose and keeps a raw pointer + // to it. QDialog::exec() deletes that helper dialog when it closes, so the later + // hide() call from ~QMessageBox dereferences freed memory and can kill the app. + QApplication::setAttribute(Qt::AA_DontUseNativeDialogs); + /// 2. Application identification QApplication::setOrganizationName("cachyos"); QApplication::setOrganizationDomain("cachyos.org");