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

Merge remote-tracking branch 'origin/qt6-support' into qt6-kde

This commit is contained in:
Elias Steurer 2021-12-02 16:16:29 +01:00
commit 41fb12c6b1
6 changed files with 43 additions and 14 deletions

View File

@ -2,7 +2,6 @@ stages:
- check
- build
- test
- benchmark
check:
stage: check

View File

@ -160,7 +160,6 @@ qt_update_translations("${CMAKE_CURRENT_SOURCE_DIR}/qml" "${L10N_LIST}")
# Needed on macos
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(benchmark CONFIG REQUIRED)
find_package(doctest CONFIG REQUIRED)
# CURL must be included before sentry because sentry needs the module and does not include it itself on macos...
@ -193,8 +192,6 @@ target_link_libraries(
ScreenPlayLib
PUBLIC ScreenPlaySDK
ScreenPlayUtil
benchmark::benchmark
benchmark::benchmark_main
doctest::doctest
sentry::sentry
Threads::Threads

View File

@ -135,6 +135,41 @@ QVariant MonitorListModel::data(const QModelIndex& index, int role) const
*/
void MonitorListModel::loadMonitors()
{
#ifdef Q_OS_WIN
QModelIndex index;
ScreenPlayUtil::WinMonitorStats monitors;
// This offset lets us center the monitor selection view in the center
int offsetX = 0;
int offsetY = 0;
for (int i = 0; i < monitors.iMonitors.size(); i++) {
const int x = monitors.rcMonitors[i].left;
const int y = monitors.rcMonitors[i].top;
if (x < 0) {
offsetX += (x * -1);
}
if (y < 0) {
offsetY += (y * -1);
}
}
for (int i = 0; i < monitors.iMonitors.size(); i++) {
const int width = std::abs(monitors.rcMonitors[i].right - monitors.rcMonitors[i].left);
const int height = std::abs(monitors.rcMonitors[i].top - monitors.rcMonitors[i].bottom);
const int x = monitors.rcMonitors[i].left;
const int y = monitors.rcMonitors[i].top;
QRect availableVirtualGeometry(
x + offsetX,
y + offsetY,
width,
height);
beginInsertRows(index, m_monitorList.size(), m_monitorList.size());
m_monitorList.append(Monitor { i, availableVirtualGeometry, QApplication::screens().at(i) });
endInsertRows();
}
#else
QModelIndex index;
int offsetX = 0;
int offsetY = 0;
@ -148,7 +183,6 @@ void MonitorListModel::loadMonitors()
}
}
QModelIndex index;
for (int i = 0; i < QApplication::screens().count(); i++) {
QScreen* screen = QApplication::screens().at(i);
@ -166,6 +200,7 @@ void MonitorListModel::loadMonitors()
m_monitorList.append(Monitor { i, availableVirtualGeometry, screen });
endInsertRows();
}
#endif
emit monitorReloadCompleted();
}

View File

@ -258,11 +258,11 @@ void WinWindow::setupWallpaperForOneScreen(int activeScreen)
const float scaling = getScaling(activeScreen);
const int borderOffset = -1;
ScreenPlayUtil::WinMonitorStats Monitors;
const int width = std::abs(Monitors.rcMonitors[activeScreen].right - Monitors.rcMonitors[activeScreen].left);
const int height = std::abs(Monitors.rcMonitors[activeScreen].top - Monitors.rcMonitors[activeScreen].bottom);
const int x = Monitors.rcMonitors[activeScreen].left + m_zeroPoint.x() + borderOffset;
const int y = Monitors.rcMonitors[activeScreen].top + m_zeroPoint.y() + borderOffset;
ScreenPlayUtil::WinMonitorStats monitors;
const int width = std::abs(monitors.rcMonitors[activeScreen].right - monitors.rcMonitors[activeScreen].left);
const int height = std::abs(monitors.rcMonitors[activeScreen].top - monitors.rcMonitors[activeScreen].bottom);
const int x = monitors.rcMonitors[activeScreen].left + m_zeroPoint.x() + borderOffset;
const int y = monitors.rcMonitors[activeScreen].top + m_zeroPoint.y() + borderOffset;
qInfo() << QString("Setup window activeScreen: %1 scaling: %2 x: %3 y: %4 width: %5 height: %6").arg(activeScreen).arg(scaling).arg(x).arg(y).arg(width).arg(height);
{

View File

@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD 20)
find_package(
Qt6
COMPONENTS Quick Widgets Gui
COMPONENTS Quick Widgets Gui
REQUIRED)
set(SOURCES

View File

@ -31,7 +31,7 @@ if __name__ == "__main__":
vcpkg_path = os.path.join(project_source_parent_path, "ScreenPlay-vcpkg")
print("vcpkg_path: ", vcpkg_path)
vcpkg_version = "c1bd850c629977b98b71bd7a6ab6b7949a5f07e6" # Master 25.06.2021
vcpkg_version = "5ddd7f0" # Master 02.12.2021
print("Build vcpkg ", vcpkg_version)
execute("git fetch", vcpkg_path)
execute("git checkout {}".format(vcpkg_version), vcpkg_path)
@ -41,8 +41,6 @@ if __name__ == "__main__":
"curl",
"sentry-native",
"doctest",
"benchmark",
"libarchive",
"cpp-httplib"
]