1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 02:32:29 +01:00

Add mac includes

Add missing include
This commit is contained in:
Elias 2019-04-04 17:20:13 +02:00
parent 161b77fd37
commit 8b38f59909
3 changed files with 19 additions and 20 deletions

View File

@ -12,12 +12,8 @@
#include "src/linuxwindow.h"
#endif
#if defined(Q_OS_OSX)
// TODO MAC OSX PORT HERE
#include "src/macwindow.h"
#endif
#include "../ScreenPlaySDK/screenplaysdk.h"
@ -43,10 +39,14 @@ int main(int argc, char* argv[])
list.append(0);
#if defined(Q_OS_WIN)
WinWindow window(list, "test", "appid", "1");
// WinWindow window(list, "D:/672870/827874818", "appid", "1");
#endif
#if defined(Q_OS_LINUX)
LinuxWindow window(list, "test", "appid", "1");
#endif
#if defined(Q_OS_OSX)
LinuxWindow window(list, "test", "appid", "1");
#endif
return app.exec();
}
@ -97,11 +97,9 @@ int main(int argc, char* argv[])
#endif
#if defined(Q_OS_OSX)
// TODO MAC OSX PORT HERE
// QObject::connect(&sdk, &ScreenPlaySDK::sdkDisconnected, &TODO, &TODO::destroyThis);
// QObject::connect(&sdk, &ScreenPlaySDK::incommingMessage, &TODO, &TODO::messageReceived);
MacWindow window(list, argumentList.at(2), argumentList.at(3), argumentList.at(5));
QObject::connect(&sdk, &ScreenPlaySDK::sdkDisconnected, &MacWindow, &MacWindow::destroyThis);
QObject::connect(&sdk, &ScreenPlaySDK::incommingMessage, &MacWindow, &MacWindow::messageReceived);
#endif
return app.exec();

View File

@ -1,6 +1,6 @@
import QtQuick 2.12
import QtWebEngine 1.8
//import net.aimber.wallpaper 1.0
import net.aimber.wallpaper 1.0
Rectangle {
anchors.fill: parent

View File

@ -18,7 +18,7 @@ WinWindow::WinWindow(QVector<int>& activeScreensList, QString projectPath, QStri
{
m_windowHandle = reinterpret_cast<HWND>(m_window.winId());
if(!IsWindow(m_windowHandle)){
if (!IsWindow(m_windowHandle)) {
qFatal("Could not get a valid window handle!");
}
setAppID(id);
@ -59,20 +59,21 @@ WinWindow::WinWindow(QVector<int>& activeScreensList, QString projectPath, QStri
m_window.setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
m_window.setSource(QUrl("qrc:/mainWindow.qml"));
// Let QML decide when were are read to show the window
ShowWindow(m_windowHandle, SW_HIDE);
// FIXME WORKAROUND:
// There is a strange bug when we open the ScreenPlayWindow project on its one
// that if we set ShowWindow(m_windowHandle, SW_HIDE); we can no longer set
// the window visible via set Visible.
if(projectPath != "test"){
// Let QML decide when were are read to show the window
ShowWindow(m_windowHandle, SW_HIDE);
}
}
void WinWindow::setVisible(bool show)
{
if (show) {
ShowWindow(m_windowHandle, SW_SHOW);
if(!IsWindowVisible(m_windowHandle)){
qFatal("Could net set window visible!");
}
m_window.show();
} else {
ShowWindow(m_windowHandle, SW_HIDE);
}