Le 25/03/2026 à 11:28, Jean-Marc Lasgouttes a écrit :
Le 25/03/2026 à 08:39, Pavel Sanda a écrit :
An even simpler patch would be to skip the dispatch and call the method
directly.
Here is the final patch I have in mind. The gist of it is to close
buffers instead of closing windows, because with Tahoe it seems that
there are games played with windows. And it is buffers that can trigger
dialogs.
Testing on macOS wanted.
JMarc
From 98ccd2b655299ca0546a263fc67dbd1719b28dbf Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <[email protected]>
Date: Wed, 25 Mar 2026 15:20:08 +0100
Subject: [PATCH] fixup 3b6ec13d: better fix for SIGABRT at exiting time on
macOS Tahoe
Instead of a specific code for macOS Tahoe, use
GuiView::closeBufferAll() instead of GuiApplication::closeAllViews().
---
src/frontends/qt/GuiApplication.cpp | 20 ++++++++------------
src/frontends/qt/GuiView.h | 5 +++--
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp
index d658cec6cb..e786fea150 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -1794,20 +1794,16 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
break;
case LFUN_LYX_QUIT:
- // Temporary and imperfect fix for SIGABRT at exiting time on macOS
- // Tahoe. See
- // https://www.mail-archive.com/[email protected]/msg225496.html
- // FIXME: This fix should be removed once the problem is gone.
-#if defined(Q_OS_MACOS) && QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 26))
- std::this_thread::sleep_for(std::chrono::seconds(2));
-#endif
+ if (current_view_) {
+ current_view_->message(from_utf8(N_("Exiting.")));
+ if (!current_view_->closeBufferAll()) {
+ current_view_->message(from_utf8(N_("Cancelled")));
+ break;
+ }
+ }
// quitting is triggered by the gui code
// (leaving the event loop).
- if (current_view_)
- current_view_->message(from_utf8(N_("Exiting.")));
- if (closeAllViews())
- quit();
+ QApplication::quit();
break;
case LFUN_SCREEN_FONT_UPDATE: {
diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
index b553013851..727cd4ccec 100644
--- a/src/frontends/qt/GuiView.h
+++ b/src/frontends/qt/GuiView.h
@@ -165,6 +165,9 @@ public:
bool closeWorkArea(GuiWorkArea * wa);
/// closes the buffer
bool closeBuffer(Buffer & buf);
+ /// Close all document buffers.
+ bool closeBufferAll();
+
///
void openDocuments(std::string const & filename, int origin);
///
@@ -325,8 +328,6 @@ private:
void openChildDocument(std::string const & filename);
/// Close current document buffer.
bool closeBuffer();
- /// Close all document buffers.
- bool closeBufferAll();
///
TabWorkArea * addTabWorkArea();
--
2.43.0
--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel