mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
Merge pull request #6937 from beaumanvienna/retrorig-pl1
dual head support (SDL_VIDEO_FULLSCREEN_HEAD) for Qt and SDL2
This commit is contained in:
commit
796e9ab880
3 files changed
+22
-5
No files matched your search
+19
-3
@@ -15,7 +15,7 @@
|
||||
#include "GPU/GPUInterface.h"
|
||||
#include "UI/GamepadEmu.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
MainWindow::MainWindow(QWidget *parent, bool fullscreen) :
|
||||
QMainWindow(parent),
|
||||
currentLanguage("en"),
|
||||
nextState(CORE_POWERDOWN),
|
||||
@@ -25,10 +25,12 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
memoryTexWindow(0),
|
||||
displaylistWindow(0)
|
||||
{
|
||||
// Allow creation on custom screen
|
||||
QDesktopWidget *desktop = QApplication::desktop();
|
||||
int screenNum = QProcessEnvironment::systemEnvironment().value("SDL_VIDEO_FULLSCREEN_HEAD", "0").toInt();
|
||||
|
||||
// Move window to top left coordinate of selected screen
|
||||
move(qApp->desktop()->screen(screenNum)->pos());
|
||||
QRect rect = desktop->screenGeometry(screenNum);
|
||||
move(rect.topLeft());
|
||||
|
||||
SetGameTitle("");
|
||||
emugl = new MainUI(this);
|
||||
@@ -38,6 +40,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
updateMenus();
|
||||
|
||||
SetZoom(g_Config.iInternalResolution);
|
||||
|
||||
if(fullscreen)
|
||||
fullscrAct();
|
||||
|
||||
QObject::connect(emugl, SIGNAL(doubleClick()), this, SLOT(fullscrAct()));
|
||||
QObject::connect(emugl, SIGNAL(newFrame()), this, SLOT(newFrame()));
|
||||
@@ -334,6 +339,15 @@ void MainWindow::stretchAct()
|
||||
gpu->Resized();
|
||||
}
|
||||
|
||||
void MainWindow::raiseTopMost()
|
||||
{
|
||||
|
||||
setWindowState( (windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
raise();
|
||||
activateWindow();
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::fullscrAct()
|
||||
{
|
||||
if(isFullScreen()) {
|
||||
@@ -364,6 +378,8 @@ void MainWindow::fullscrAct()
|
||||
QApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
|
||||
|
||||
}
|
||||
|
||||
QTimer::singleShot(1000, this, SLOT(raiseTopMost()));
|
||||
}
|
||||
|
||||
void MainWindow::websiteAct()
|
||||
|
||||
+2
-1
@@ -26,7 +26,7 @@ class MainWindow : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
explicit MainWindow(QWidget *parent = 0, bool fullscreen=false);
|
||||
~MainWindow() { };
|
||||
|
||||
Debugger_Disasm* GetDialogDisasm() { return dialogDisasm; }
|
||||
@@ -109,6 +109,7 @@ private slots:
|
||||
void audioAct() { g_Config.bEnableSound = !g_Config.bEnableSound; }
|
||||
|
||||
void fullscrAct();
|
||||
void raiseTopMost();
|
||||
void statsAct() { g_Config.bShowDebugStats = !g_Config.bShowDebugStats; }
|
||||
void showFPSAct() { g_Config.iShowFPSCounter = !g_Config.iShowFPSCounter; }
|
||||
|
||||
|
||||
+1
-1
@@ -454,7 +454,7 @@ void NativeInit(int argc, const char *argv[],
|
||||
isOuya = KeyMap::IsOuya(sysName);
|
||||
|
||||
#if !defined(MOBILE_DEVICE) && defined(USING_QT_UI)
|
||||
MainWindow* mainWindow = new MainWindow(0);
|
||||
MainWindow* mainWindow = new MainWindow(0,fs);
|
||||
mainWindow->show();
|
||||
host = new QtHost(mainWindow);
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user