mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-30 17:53:42 +01:00
Make Qt apply fullscreen change from UI as well
This commit is contained in:
1 parent
cd42f8b3a6
commit
4c0908ef44
1 file changed
+10
-10
+10
-10
@@ -24,13 +24,6 @@ MainWindow::MainWindow(QWidget *parent, bool fullscreen) :
|
||||
nextState(CORE_POWERDOWN),
|
||||
lastUIState(UISTATE_MENU)
|
||||
{
|
||||
QDesktopWidget *desktop = QApplication::desktop();
|
||||
int screenNum = QProcessEnvironment::systemEnvironment().value("SDL_VIDEO_FULLSCREEN_HEAD", "0").toInt();
|
||||
|
||||
// Move window to the center of selected screen
|
||||
QRect rect = desktop->screenGeometry(screenNum);
|
||||
move((rect.width() - frameGeometry().width()) / 4, (rect.height() - frameGeometry().height()) / 4);
|
||||
|
||||
setWindowIcon(QIcon(qApp->applicationDirPath() + "/assets/icon_regular_72.png"));
|
||||
|
||||
SetGameTitle("");
|
||||
@@ -64,6 +57,9 @@ void MainWindow::newFrame()
|
||||
updateMenus();
|
||||
}
|
||||
|
||||
if (g_Config.bFullScreen != isFullScreen())
|
||||
SetFullScreen(g_Config.bFullScreen);
|
||||
|
||||
std::unique_lock<std::mutex> lock(msgMutex_);
|
||||
while (!msgQueue_.empty()) {
|
||||
MainWindowMsg msg = msgQueue_.front();
|
||||
@@ -112,9 +108,6 @@ void MainWindow::updateMenus()
|
||||
|
||||
void MainWindow::bootDone()
|
||||
{
|
||||
if (g_Config.bFullScreen != isFullScreen())
|
||||
SetFullScreen(g_Config.bFullScreen);
|
||||
|
||||
if (nextState == CORE_RUNNING)
|
||||
runAct();
|
||||
updateMenus();
|
||||
@@ -389,6 +382,13 @@ void MainWindow::SetFullScreen(bool fullscreen) {
|
||||
|
||||
if (GetUIState() == UISTATE_INGAME && QApplication::overrideCursor())
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
QDesktopWidget *desktop = QApplication::desktop();
|
||||
int screenNum = QProcessEnvironment::systemEnvironment().value("SDL_VIDEO_FULLSCREEN_HEAD", "0").toInt();
|
||||
|
||||
// Move window to the center of selected screen
|
||||
QRect rect = desktop->screenGeometry(screenNum);
|
||||
move((rect.width() - frameGeometry().width()) / 4, (rect.height() - frameGeometry().height()) / 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user