diff --git a/base/QtMain.cpp b/base/QtMain.cpp index 69137ead14..1f79499e48 100644 --- a/base/QtMain.cpp +++ b/base/QtMain.cpp @@ -13,6 +13,9 @@ #ifdef __SYMBIAN32__ #include #endif +#ifdef Q_WS_X11 +#include "mainwindow.h" +#endif #include "QtMain.h" void LaunchBrowser(const char *url) @@ -52,6 +55,9 @@ float CalculateDPIScale() int main(int argc, char *argv[]) { +#ifdef Q_WS_X11 + QApplication::setAttribute(Qt::AA_X11InitThreads, true); +#endif QApplication a(argc, argv); // Lock orientation to landscape on Symbian #ifdef __SYMBIAN32__ @@ -75,16 +81,24 @@ int main(int argc, char *argv[]) NativeInit(argc, (const char **)argv, "E:/PPSSPP/", "E:", "BADCOFFEE"); #elif defined(BLACKBERRY) NativeInit(argc, (const char **)argv, "data/", "/tmp", "BADCOFFEE"); +#elif defined(Q_WS_X11) + // Temporary until ppsspp is fixed #else NativeInit(argc, (const char **)argv, "./", "/tmp", "BADCOFFEE"); #endif +#ifdef Q_WS_X11 + MainWindow mainWindow; + mainWindow.show(); + mainWindow.Create(argc, (const char **)argv, "./", "/tmp", "BADCOFFEE"); +#else MainUI w(dpi_scale); w.resize(pixel_xres, pixel_yres); #ifdef USING_GLES2 w.showFullScreen(); #else w.show(); +#endif #endif MainAudio *audio = new MainAudio(); diff --git a/base/QtMain.h b/base/QtMain.h index 4c47054504..0cf76cefa1 100644 --- a/base/QtMain.h +++ b/base/QtMain.h @@ -88,7 +88,7 @@ protected: break; } } - break; + break; case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: input_state.pointer_down[0] = (e->type() == QEvent::MouseButtonPress); @@ -161,11 +161,13 @@ public: output = new QAudioOutput(fmt); output->setNotifyInterval(1000*AUDIO_SAMPLES / AUDIO_FREQ); output->setBufferSize(mixlen); - this->connect(output, SIGNAL(notify()), this, SLOT(writeData())); + connect(output, SIGNAL(notify()), this, SLOT(writeData())); feed = output->start(); } ~MainAudio() { + feed->close(); delete feed; + output->stop(); delete output; free(mixbuf); }