1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Remove wallpaper when monitor setup changed. For now we do not try to recreate the setup.

This commit is contained in:
Elias Steurer 2019-10-08 19:09:55 +02:00
parent da9d549228
commit de3d3f5c28
2 changed files with 8 additions and 6 deletions

View File

@ -42,6 +42,7 @@ App::App()
// When the installed storage path changed
QObject::connect(m_settings.get(), &Settings::resetInstalledListmodel, m_installedListModel.get(), &InstalledListModel::reset);
QObject::connect(m_monitorListModel.get(), &MonitorListModel::monitorConfigurationChanged, m_sdkConnector.get(), &SDKConnector::closeAllWallpapers);
// Init after we have the paths from settings
m_installedListModel->init();

View File

@ -6,7 +6,6 @@
#include <QGuiApplication>
#include <QRect>
#include <QScreen>
#include <QSharedPointer>
#include <QSize>
#include <QString>
#include <QVector>
@ -80,10 +79,11 @@ public:
std::optional<QString> getAppIDByMonitorIndex(const int index) const;
signals:
void monitorReloadCompleted();
void setNewActiveMonitor(int index, QString path);
void monitorListChanged();
void monitorConfigurationChanged();
public slots:
void reset();
@ -92,14 +92,14 @@ public slots:
void screenAdded(QScreen* screen)
{
Q_UNUSED(screen)
qDebug() << "screenAdded";
qDebug() << "screenAdded" << screen->geometry()<< m_monitorList.size();
emit monitorConfigurationChanged();
reset();
}
void screenRemoved(QScreen* screen)
{
Q_UNUSED(screen)
qDebug() << "screenRemoved";
qDebug() << "screenRemoved"<< screen->geometry() << m_monitorList.size();
emit monitorConfigurationChanged();
reset();
}
@ -109,6 +109,7 @@ public slots:
return app->screens().at(0)->availableVirtualGeometry();
}
private:
void loadMonitors();