mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
Fix UI freeze on macOS game-list population
it seems like the initial call to `GameList::PopulateAsync` in the window constructor is too early in the app life-cycle and doesn't run asynchronously, or Qt is using macOS API in an esoteric way, or maybe it's something else entirely. Moving the list population to happen before the window is shown instead appears to fix the issue.
This commit is contained in:
parent
0f9d5f29f3
commit
fe2f637467
2 changed files with 6 additions and 3 deletions
|
|
@ -432,9 +432,6 @@ GMainWindow::GMainWindow(Core::System& system_)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
game_list->LoadCompatibilityList();
|
|
||||||
game_list->PopulateAsync(UISettings::values.game_dirs);
|
|
||||||
|
|
||||||
mouse_hide_timer.setInterval(default_mouse_timeout);
|
mouse_hide_timer.setInterval(default_mouse_timeout);
|
||||||
connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor);
|
connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor);
|
||||||
connect(ui->menubar, &QMenuBar::hovered, this, &GMainWindow::OnMouseActivity);
|
connect(ui->menubar, &QMenuBar::hovered, this, &GMainWindow::OnMouseActivity);
|
||||||
|
|
@ -3738,6 +3735,11 @@ void GMainWindow::mouseReleaseEvent([[maybe_unused]] QMouseEvent* event) {
|
||||||
OnMouseActivity();
|
OnMouseActivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GMainWindow::showEvent([[maybe_unused]] QShowEvent* event) {
|
||||||
|
game_list->LoadCompatibilityList();
|
||||||
|
game_list->PopulateAsync(UISettings::values.game_dirs);
|
||||||
|
}
|
||||||
|
|
||||||
void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string details) {
|
void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string details) {
|
||||||
QString status_message;
|
QString status_message;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -461,6 +461,7 @@ protected:
|
||||||
void mouseMoveEvent(QMouseEvent* event) override;
|
void mouseMoveEvent(QMouseEvent* event) override;
|
||||||
void mousePressEvent(QMouseEvent* event) override;
|
void mousePressEvent(QMouseEvent* event) override;
|
||||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||||
|
void showEvent(QShowEvent* event) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GApplicationEventFilter : public QObject {
|
class GApplicationEventFilter : public QObject {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue