mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
dual head support for Qt reworked / --fullscreen for Qt / fullscreen top most
This commit is contained in:
parent
eb0ca946e9
commit
2bc6864222
2 changed files with 53 additions and 2 deletions
|
@ -15,7 +15,39 @@
|
||||||
#include "GPU/GPUInterface.h"
|
#include "GPU/GPUInterface.h"
|
||||||
#include "UI/GamepadEmu.h"
|
#include "UI/GamepadEmu.h"
|
||||||
|
|
||||||
int getDisplayNumber(void);
|
// "--fullscreen" from command line interface
|
||||||
|
extern bool fullscreenCLI;
|
||||||
|
|
||||||
|
//Dual Head Support
|
||||||
|
int getNumVideoDisplays(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
QDesktopWidget *desktop = QApplication::desktop();
|
||||||
|
return desktop->screenCount();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Dual Head Support
|
||||||
|
int getDisplayNumber(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
int tempValue, displayNumber;
|
||||||
|
|
||||||
|
//get environment
|
||||||
|
tempValue = QProcessEnvironment::systemEnvironment().value("SDL_VIDEO_FULLSCREEN_HEAD", "0").toInt();
|
||||||
|
|
||||||
|
// setup default: primary display
|
||||||
|
displayNumber = 0;
|
||||||
|
|
||||||
|
//check if larger equal -1 (= default screen) and less then display numbers
|
||||||
|
if ((tempValue >=-1) && (tempValue < getNumVideoDisplays()))
|
||||||
|
{
|
||||||
|
// check passed
|
||||||
|
displayNumber = tempValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return displayNumber;
|
||||||
|
}
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
|
@ -27,7 +59,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
memoryTexWindow(0),
|
memoryTexWindow(0),
|
||||||
displaylistWindow(0)
|
displaylistWindow(0)
|
||||||
{
|
{
|
||||||
|
// timer needed to bring window on top
|
||||||
|
timer = new QTimer(this);
|
||||||
QDesktopWidget *desktop = QApplication::desktop();
|
QDesktopWidget *desktop = QApplication::desktop();
|
||||||
QRect rect = desktop->screenGeometry(getDisplayNumber());
|
QRect rect = desktop->screenGeometry(getDisplayNumber());
|
||||||
move(rect.topLeft());
|
move(rect.topLeft());
|
||||||
|
@ -40,6 +73,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
updateMenus();
|
updateMenus();
|
||||||
|
|
||||||
SetZoom(g_Config.iInternalResolution);
|
SetZoom(g_Config.iInternalResolution);
|
||||||
|
|
||||||
|
if(fullscreenCLI)
|
||||||
|
fullscrAct();
|
||||||
|
|
||||||
QObject::connect(emugl, SIGNAL(doubleClick()), this, SLOT(fullscrAct()));
|
QObject::connect(emugl, SIGNAL(doubleClick()), this, SLOT(fullscrAct()));
|
||||||
QObject::connect(emugl, SIGNAL(newFrame()), this, SLOT(newFrame()));
|
QObject::connect(emugl, SIGNAL(newFrame()), this, SLOT(newFrame()));
|
||||||
|
@ -336,6 +372,16 @@ void MainWindow::stretchAct()
|
||||||
gpu->Resized();
|
gpu->Resized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::raiseTopMost()
|
||||||
|
{
|
||||||
|
|
||||||
|
setWindowState( (windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||||
|
raise();
|
||||||
|
activateWindow();
|
||||||
|
timer->stop();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::fullscrAct()
|
void MainWindow::fullscrAct()
|
||||||
{
|
{
|
||||||
if(isFullScreen()) {
|
if(isFullScreen()) {
|
||||||
|
@ -366,6 +412,9 @@ void MainWindow::fullscrAct()
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(timer, SIGNAL(timeout()), this, SLOT(raiseTopMost()));
|
||||||
|
timer->start(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::websiteAct()
|
void MainWindow::websiteAct()
|
||||||
|
|
|
@ -109,6 +109,7 @@ private slots:
|
||||||
void audioAct() { g_Config.bEnableSound = !g_Config.bEnableSound; }
|
void audioAct() { g_Config.bEnableSound = !g_Config.bEnableSound; }
|
||||||
|
|
||||||
void fullscrAct();
|
void fullscrAct();
|
||||||
|
void raiseTopMost();
|
||||||
void statsAct() { g_Config.bShowDebugStats = !g_Config.bShowDebugStats; }
|
void statsAct() { g_Config.bShowDebugStats = !g_Config.bShowDebugStats; }
|
||||||
void showFPSAct() { g_Config.iShowFPSCounter = !g_Config.iShowFPSCounter; }
|
void showFPSAct() { g_Config.iShowFPSCounter = !g_Config.iShowFPSCounter; }
|
||||||
|
|
||||||
|
@ -143,6 +144,7 @@ private:
|
||||||
|
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
QString currentLanguage;
|
QString currentLanguage;
|
||||||
|
QTimer *timer;
|
||||||
|
|
||||||
CoreState nextState;
|
CoreState nextState;
|
||||||
InputState input_state;
|
InputState input_state;
|
||||||
|
|
Loading…
Add table
Reference in a new issue