mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #7206 from delroth/qt-boottime
dqt2: lazy-initialize GraphicsWindow
This commit is contained in:
@ -27,6 +27,17 @@
|
|||||||
GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent)
|
GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent)
|
||||||
: QDialog(parent), m_xrr_config(xrr_config)
|
: QDialog(parent), m_xrr_config(xrr_config)
|
||||||
{
|
{
|
||||||
|
// GraphicsWindow initialization is heavy due to dependencies on the graphics subsystem.
|
||||||
|
// To prevent blocking startup, we create the layout and children at first show time.
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphicsWindow::Initialize()
|
||||||
|
{
|
||||||
|
if (m_lazy_initialized)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_lazy_initialized = true;
|
||||||
|
|
||||||
g_Config.Refresh();
|
g_Config.Refresh();
|
||||||
g_video_backend->InitBackendInfo();
|
g_video_backend->InitBackendInfo();
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ class GraphicsWindow final : public QDialog
|
|||||||
public:
|
public:
|
||||||
explicit GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent);
|
explicit GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent);
|
||||||
|
|
||||||
|
void Initialize();
|
||||||
|
|
||||||
void RegisterWidget(GraphicsWidget* widget);
|
void RegisterWidget(GraphicsWidget* widget);
|
||||||
bool eventFilter(QObject* object, QEvent* event) override;
|
bool eventFilter(QObject* object, QEvent* event) override;
|
||||||
signals:
|
signals:
|
||||||
@ -39,6 +41,8 @@ private:
|
|||||||
void OnBackendChanged(const QString& backend);
|
void OnBackendChanged(const QString& backend);
|
||||||
void OnDescriptionAdded(QWidget* widget, const char* description);
|
void OnDescriptionAdded(QWidget* widget, const char* description);
|
||||||
|
|
||||||
|
bool m_lazy_initialized = false;
|
||||||
|
|
||||||
QTabWidget* m_tab_widget;
|
QTabWidget* m_tab_widget;
|
||||||
QLabel* m_description;
|
QLabel* m_description;
|
||||||
QDialogButtonBox* m_button_box;
|
QDialogButtonBox* m_button_box;
|
||||||
|
@ -935,6 +935,7 @@ void MainWindow::ShowHotkeyDialog()
|
|||||||
|
|
||||||
void MainWindow::ShowGraphicsWindow()
|
void MainWindow::ShowGraphicsWindow()
|
||||||
{
|
{
|
||||||
|
m_graphics_window->Initialize();
|
||||||
m_graphics_window->show();
|
m_graphics_window->show();
|
||||||
m_graphics_window->raise();
|
m_graphics_window->raise();
|
||||||
m_graphics_window->activateWindow();
|
m_graphics_window->activateWindow();
|
||||||
|
Reference in New Issue
Block a user