Merge branch 'collecting-main-patch-94126' into 'main'

QObject::connect Error

See merge request citron/emulator!33
This commit is contained in:
Zephyron
2025-09-23 21:04:08 +10:00

View File

@@ -1124,9 +1124,12 @@ void GRenderWindow::OnEmulationStopping() {
void GRenderWindow::showEvent(QShowEvent* event) {
QWidget::showEvent(event);
// windowHandle() is not initialized until the Window is shown, so we connect it here.
connect(windowHandle(), &QWindow::screenChanged, this, &GRenderWindow::OnFramebufferSizeChanged,
Qt::UniqueConnection);
// windowHandle() is not guaranteed to be initialized until after the window is shown.
// We connect here, but check for null to prevent a non-fatal error message on some platforms.
if (windowHandle()) {
connect(windowHandle(), &QWindow::screenChanged, this, &GRenderWindow::OnFramebufferSizeChanged,
Qt::UniqueConnection);
}
}
bool GRenderWindow::eventFilter(QObject* object, QEvent* event) {