on xenial help sign in
[ShellApplication] Use (new) screenRemoved event from upstream qt
2a9d044Marius Gripsgard
src/ShellApplication.cpp+2−1
@@ -41,6 +41,7 @@ ShellApplication::ShellApplication(int & argc, char ** argv, bool isMirServer)
41 setOrganizationName(QStringLiteral("Canonical"));
41 setOrganizationName(QStringLiteral("Canonical"));
42
42
43 connect(this, &QGuiApplication::screenAdded, this, &ShellApplication::onScreenAdded);
43 connect(this, &QGuiApplication::screenAdded, this, &ShellApplication::onScreenAdded);
44+ connect(this, &QGuiApplication::screenRemoved, this, &ShellApplication::onScreenRemoved);
44
45
45 setupQmlEngine(isMirServer);
46 setupQmlEngine(isMirServer);
46
47
@@ -198,7 +199,7 @@ void ShellApplication::onScreenAdded(QScreen * /*screen*/)
198 }
199 }
199}
200}
200
201
201−void ShellApplication::onScreenAboutToBeRemoved(QScreen *screen)
202+void ShellApplication::onScreenRemoved(QScreen *screen)
202{
203{
203 // TODO: Support an arbitrary number of screens and different policies
204 // TODO: Support an arbitrary number of screens and different policies
204 // (eg cloned desktop, several desktops, etc)
205 // (eg cloned desktop, several desktops, etc)
src/ShellApplication.h+1−3
@@ -39,12 +39,10 @@ public:
39 virtual ~ShellApplication();
39 virtual ~ShellApplication();
40
40
41 void destroyResources();
41 void destroyResources();
42−public Q_SLOTS:
43− // called by qtmir
44− void onScreenAboutToBeRemoved(QScreen *screen);
45
42
46private Q_SLOTS:
43private Q_SLOTS:
47 void onScreenAdded(QScreen*);
44 void onScreenAdded(QScreen*);
45+ void onScreenRemoved(QScreen*);
48
46
49private:
47private:
50 void setupQmlEngine(bool isMirServer);
48 void setupQmlEngine(bool isMirServer);