Fix double-clicking a .aseprite file in macOS Finder doesn't open the file anymore (fix #2985)

More info in: #3006
This commit is contained in:
Gaspar Capello 2021-10-15 23:29:09 -03:00 committed by David Capello
parent ea703a38e6
commit f15589734f

View File

@ -325,17 +325,15 @@ int App::initialize(const AppOptions& options)
// Show the main window (this is not modal, the code continues)
m_mainWindow->openWindow();
// Redraw the whole screen.
manager->invalidate();
// Pump some messages so we receive the first
// Manager::onNewDisplayConfiguration() and we known the manager
// initial size. This is required so if the OpenFileCommand
// (called when we're processing the CLI with OpenBatchOfFiles)
// shows a dialog to open a sequence of files, the dialog is
// centered correctly to the manager bounds.
ui::MessageLoop loop(manager);
loop.pumpMessages();
// To know the initial manager size we call to
// Manager::updateAllDisplaysWithNewScale(...) so we receive a
// Manager::onNewDisplayConfiguration() (which will update the
// bounds of the manager for first time). This is required so if
// the OpenFileCommand (called when we're processing the CLI with
// OpenBatchOfFiles) shows a dialog to open a sequence of files,
// the dialog is centered correctly to the manager bounds.
const int scale = Preferences::instance().general.screenScale();
manager->updateAllDisplaysWithNewScale(scale);
}
#endif // ENABLE_UI