Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions desktop/inc/app.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class Desktop final : public Application
private:
void RegisterServices();
static void DeregisterServices();
static void EnsureStartCenterFallbackMenubar();

public:
static void CreateTemporaryDirectory();
Expand Down
52 changes: 23 additions & 29 deletions desktop/source/app/app.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2200,20 +2200,8 @@ void Desktop::OpenClients()
xBox->run();
}

#ifdef MACOSX
// Related: tdf#41775 show Start Center before loading documents
// If LibreOffice is launched from the command line with a
// document path parameter, the Start Center doesn't get
// created when all of the document windows are closed. This
// causes the old "File only" menubar to be displayed
// instead of the Start Center's menubar.
if (!rArgs.IsQuickstart() && !rArgs.IsInvisible())
{
SvtModuleOptions aOpt;
if (aOpt.IsModuleInstalled(SvtModuleOptions::EModule::STARTMODULE))
ShowBackingComponent(nullptr);
}
#endif
EnsureStartCenterFallbackMenubar();

// Process request
DispatchRequestFlags eFlags = DispatchRequestFlags::NONE;
aRequest.mpFlags = &eFlags;
Expand All @@ -2235,28 +2223,34 @@ void Desktop::OpenClients()

if ( rArgs.IsQuickstart() || rArgs.IsInvisible() || Application::AnyInput( VclInputFlags::APPEVENT ) )
{
#ifdef MACOSX
// Related: tdf#41775 show Start Center before loading documents
// If LibreOffice is launched from by opening a document from the
// Finder or dragging it onto the application's Dock icon, the
// the Start Center doesn't get created when all of the document
// windows are closed. This causes the old "File only" menubar
// to be displayed instead of the Start Center's menubar.
if (!rArgs.IsQuickstart() && !rArgs.IsInvisible())
{
SvtModuleOptions aOpt;
if (aOpt.IsModuleInstalled(SvtModuleOptions::EModule::STARTMODULE))
ShowBackingComponent(nullptr);
}
#endif

EnsureStartCenterFallbackMenubar();
// soffice was started as tray icon ...
return;
}

OpenDefault();
}

void Desktop::EnsureStartCenterFallbackMenubar()
{
#ifdef MACOSX
// Related: tdf#41775 show Start Center before loading documents
//
// If LibreOffice is launched by opening a document from the Finder, or
// dragging a document onto its Dock icon, or from a command-line with a
// document path parameter, the Start Center doesn't get created when all
// of the document windows are closed. This causes the old "File only"
// menubar to be displayed instead of the Start Center's menubar.
const CommandLineArgs& rArgs = GetCommandLineArgs();
if (!rArgs.IsQuickstart() && !rArgs.IsInvisible())
{
SvtModuleOptions aOpt;
if (aOpt.IsModuleInstalled(SvtModuleOptions::EModule::STARTMODULE))
ShowBackingComponent(nullptr);
}
#endif
}

void Desktop::OpenDefault()
{
OUString aName;
Expand Down
Loading