Le 25/03/2026 à 08:39, Pavel Sanda a écrit :
On Wed, Mar 25, 2026 at 01:48:31PM +0900, Koji Yokota wrote:
IMHO, this is benign and seems natural behaviour for me.
Another option would be to fix it. One way is to detect th result
of close all lfun, second option could be adding flag to lyx-quit
which woult let it proceed only in case no buffer is modified.
If there is no machinery for the return value in the first
fix-scenario the second is probably easier to implement -
it's just iteration over opened buffers to have the check done...
What about this? I removed the special code for macOS 26, but we can
keep it if we are extra paranoid for 25.1.
The point is to call GuiView::closeBufferAll instead of
GuiApplication::closeAllViews.
GuiView::closeBufferAll should actually be moved elsewhere, it is not
related to the view as far as I can see. But this is for later.
An even simpler patch would be to skip the dispatch and call the method
directly.
Thoughts? Does it fix the issue on macOS?
JMarc
diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp
index d658cec6cb..215f4d02bc 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -1793,22 +1793,16 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
current_view_->closeScheduled();
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
- // quitting is triggered by the gui code
- // (leaving the event loop).
+ case LFUN_LYX_QUIT: {
if (current_view_)
current_view_->message(from_utf8(N_("Exiting.")));
- if (closeAllViews())
+ DispatchResult dr = lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE_ALL));
+ if (!dr.error())
+ // quitting is triggered by the gui code
+ // (leaving the event loop).
quit();
break;
+ }
case LFUN_SCREEN_FONT_UPDATE: {
// handle the screen font changes.
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 3edfdc29f8..d8f7a0c9e6 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -5050,7 +5050,10 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
break;
case LFUN_BUFFER_CLOSE_ALL:
- closeBufferAll();
+ if (!closeBufferAll()) {
+ dr.setError(true);
+ dr.setMessage(_("Canceled."));
+ }
break;
case LFUN_DEVEL_MODE_TOGGLE:
--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel