mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +00:00
Center the "open sequence" dialog correctly when it's showed from a file specified in the CLI (fix #2899)
This commit is contained in:
parent
1e98a65859
commit
2fa47b59c9
@ -303,7 +303,8 @@ int App::initialize(const AppOptions& options)
|
|||||||
ui::set_mouse_cursor_scale(preferences().cursor.cursorScale());
|
ui::set_mouse_cursor_scale(preferences().cursor.cursorScale());
|
||||||
ui::set_mouse_cursor(kArrowCursor);
|
ui::set_mouse_cursor(kArrowCursor);
|
||||||
|
|
||||||
ui::Manager::getDefault()->invalidate();
|
auto manager = ui::Manager::getDefault();
|
||||||
|
manager->invalidate();
|
||||||
|
|
||||||
// Create the main window.
|
// Create the main window.
|
||||||
m_mainWindow.reset(new MainWindow);
|
m_mainWindow.reset(new MainWindow);
|
||||||
@ -322,7 +323,16 @@ int App::initialize(const AppOptions& options)
|
|||||||
m_mainWindow->openWindow();
|
m_mainWindow->openWindow();
|
||||||
|
|
||||||
// Redraw the whole screen.
|
// Redraw the whole screen.
|
||||||
ui::Manager::getDefault()->invalidate();
|
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();
|
||||||
}
|
}
|
||||||
#endif // ENABLE_UI
|
#endif // ENABLE_UI
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user