diff --git a/ScreenPlay/src/sdkconnection.cpp b/ScreenPlay/src/sdkconnection.cpp index bbadddc9..9e7d92a6 100644 --- a/ScreenPlay/src/sdkconnection.cpp +++ b/ScreenPlay/src/sdkconnection.cpp @@ -94,6 +94,10 @@ void ScreenPlay::SDKConnection::readyRead() */ bool ScreenPlay::SDKConnection::sendMessage(const QByteArray& message) { + if (!m_socket) { + qWarning() << "Unable to write to unconnected socket wit message: " << message; + return false; + } m_socket->write(message); return m_socket->waitForBytesWritten(); } diff --git a/ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h b/ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h index 6005a462..0448a21a 100644 --- a/ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h +++ b/ScreenPlayUtil/inc/public/ScreenPlayUtil/util.h @@ -54,12 +54,11 @@ namespace ScreenPlayUtil { #if defined(Q_OS_WIN) struct WinMonitorStats { - std::vector iMonitors; - std::vector hMonitors; - std::vector hdcMonitors; - std::vector rcMonitors; - std::vector scaleFactor; - std::vector> sizes; + + WinMonitorStats() + { + EnumDisplayMonitors(NULL, NULL, MonitorEnum, (LPARAM)this); + } static BOOL CALLBACK MonitorEnum(HMONITOR hMon, HDC hdc, LPRECT lprcMonitor, LPARAM pData) @@ -77,10 +76,19 @@ struct WinMonitorStats { pThis->hdcMonitors.push_back(hdc); pThis->rcMonitors.push_back(*lprcMonitor); pThis->iMonitors.push_back(pThis->hdcMonitors.size()); + + //qInfo() << std::abs(lprcMonitor->right - lprcMonitor->left) << std::abs(lprcMonitor->top - lprcMonitor->bottom); + return TRUE; } - WinMonitorStats() { EnumDisplayMonitors(0, 0, MonitorEnum, (LPARAM)this); } + std::vector iMonitors; + std::vector hMonitors; + std::vector hdcMonitors; + std::vector rcMonitors; + std::vector scaleFactor; + std::vector> sizes; + int index = 0; }; #endif QJsonArray fillArray(const QVector& items);