mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-11-30 16:03:05 +00:00
citra-qt: Fix connect error on startup
This commit is contained in:
parent
f7b4f44adf
commit
541fc80240
|
@ -128,9 +128,6 @@ GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) :
|
||||||
|
|
||||||
BackupGeometry();
|
BackupGeometry();
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
|
||||||
connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, SLOT(OnFramebufferSizeChanged()));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GRenderWindow::moveContext()
|
void GRenderWindow::moveContext()
|
||||||
|
@ -278,3 +275,12 @@ void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) {
|
||||||
void GRenderWindow::OnEmulationStopping() {
|
void GRenderWindow::OnEmulationStopping() {
|
||||||
emu_thread = nullptr;
|
emu_thread = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GRenderWindow::showEvent(QShowEvent * event) {
|
||||||
|
QWidget::showEvent(event);
|
||||||
|
|
||||||
|
// windowHandle() is not initialized until the Window is shown, so we connect it here.
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -123,13 +123,12 @@ public:
|
||||||
|
|
||||||
void OnClientAreaResized(unsigned width, unsigned height);
|
void OnClientAreaResized(unsigned width, unsigned height);
|
||||||
|
|
||||||
void OnFramebufferSizeChanged();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void moveContext(); // overridden
|
void moveContext(); // overridden
|
||||||
|
|
||||||
void OnEmulationStarting(EmuThread* emu_thread);
|
void OnEmulationStarting(EmuThread* emu_thread);
|
||||||
void OnEmulationStopping();
|
void OnEmulationStopping();
|
||||||
|
void OnFramebufferSizeChanged();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/// Emitted when the window is closed
|
/// Emitted when the window is closed
|
||||||
|
@ -146,4 +145,7 @@ private:
|
||||||
int keyboard_id;
|
int keyboard_id;
|
||||||
|
|
||||||
EmuThread* emu_thread;
|
EmuThread* emu_thread;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void showEvent(QShowEvent* event) override;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue