diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp index 31cdcb7c29..57eaaf6558 100644 --- a/src/frontends/qt/GuiApplication.cpp +++ b/src/frontends/qt/GuiApplication.cpp @@ -1901,6 +1901,12 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) } case LFUN_LYXFILES_OPEN: { + // This is the actual reason for this method (#12106). + validateCurrentView(); + if (!current_view_ + || (!lyxrc.open_buffers_in_tabs + && current_view_->documentBufferView() != nullptr)) + createView(); string arg = to_utf8(cmd.argument()); if (arg.empty()) // set default