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

View File

@ -1,6 +1,6 @@
import QtQuick 2.12 import QtQuick 2.12
import QtWebEngine 1.8 import QtWebEngine 1.8
//import net.aimber.wallpaper 1.0 import net.aimber.wallpaper 1.0
Rectangle { Rectangle {
anchors.fill: parent 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()); m_windowHandle = reinterpret_cast<HWND>(m_window.winId());
if(!IsWindow(m_windowHandle)){ if (!IsWindow(m_windowHandle)) {
qFatal("Could not get a valid window handle!"); qFatal("Could not get a valid window handle!");
} }
setAppID(id); setAppID(id);
@ -59,20 +59,21 @@ WinWindow::WinWindow(QVector<int>& activeScreensList, QString projectPath, QStri
m_window.setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering); m_window.setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
m_window.setSource(QUrl("qrc:/mainWindow.qml")); m_window.setSource(QUrl("qrc:/mainWindow.qml"));
// Let QML decide when were are read to show the window // FIXME WORKAROUND:
ShowWindow(m_windowHandle, SW_HIDE); // 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) void WinWindow::setVisible(bool show)
{ {
if (show) { if (show) {
ShowWindow(m_windowHandle, SW_SHOW); ShowWindow(m_windowHandle, SW_SHOW);
if(!IsWindowVisible(m_windowHandle)){ m_window.show();
qFatal("Could net set window visible!");
}
} else { } else {
ShowWindow(m_windowHandle, SW_HIDE); ShowWindow(m_windowHandle, SW_HIDE);
} }