1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-14 22:42:34 +02:00

Remove QScreen to get valid data from windows

This commit is contained in:
Elias Steurer 2021-12-18 11:48:15 +01:00
parent 7263204616
commit 7f341e642e
2 changed files with 3 additions and 6 deletions

View File

@ -82,7 +82,7 @@ QVariant MonitorListModel::data(const QModelIndex& index, int role) const
case MonitorRole::Index:
return m_monitorList.at(row).m_index;
case MonitorRole::Geometry:
return m_monitorList.at(row).m_screen->geometry();
return m_monitorList.at(row).m_geometry;
case MonitorRole::InstalledType:
if (m_monitorList.at(row).m_activeWallpaper) {
return static_cast<int>(m_monitorList.at(row).m_activeWallpaper->type());
@ -138,7 +138,7 @@ void MonitorListModel::loadMonitors()
width,
height);
beginInsertRows(index, m_monitorList.size(), m_monitorList.size());
m_monitorList.append(Monitor { i, geometry, QApplication::screens().at(i) });
m_monitorList.append(Monitor { i, geometry });
endInsertRows();
}
#else

View File

@ -59,17 +59,14 @@ struct Monitor {
Monitor(
const int index,
const QRect& geometry,
QScreen* screen)
const QRect& geometry)
{
m_index = index;
m_geometry = geometry;
m_screen = screen;
}
int m_index { 0 };
QRect m_geometry;
QScreen* m_screen { nullptr };
std::shared_ptr<ScreenPlayWallpaper> m_activeWallpaper { nullptr };
};