on xenial help sign in
[ShellApplication] Use (new) screenRemoved event from upstream qt

This replaces unity8/qtmir's own screenRemoved event with upstream qt screenRemoved event. Qtmir's own event got added before it got implemented in qt, but they both have the same function.

commit2a9d04401513edfd5cbd963106de9c6b2d7b0fa5 authorMarius Gripsgard <marius@ubports.com> dateSun 1 Dec 2019, 02:20 (7 years ago) parent2af5f2c
2 files changed+3−4
src/ShellApplication.cpp+2−1 src/ShellApplication.h+1−3
src/ShellApplication.cpp+2−1
@@ -41,6 +41,7 @@ ShellApplication::ShellApplication(int & argc, char ** argv, bool isMirServer)
4141 setOrganizationName(QStringLiteral("Canonical"));
4242
4343 connect(this, &QGuiApplication::screenAdded, this, &ShellApplication::onScreenAdded);
44+ connect(this, &QGuiApplication::screenRemoved, this, &ShellApplication::onScreenRemoved);
4445
4546 setupQmlEngine(isMirServer);
4647
@@ -198,7 +199,7 @@ void ShellApplication::onScreenAdded(QScreen * /*screen*/)
198199 }
199200}
200201
201−void ShellApplication::onScreenAboutToBeRemoved(QScreen *screen)
202+void ShellApplication::onScreenRemoved(QScreen *screen)
202203{
203204 // TODO: Support an arbitrary number of screens and different policies
204205 // (eg cloned desktop, several desktops, etc)
src/ShellApplication.h+1−3
@@ -39,12 +39,10 @@ public:
3939 virtual ~ShellApplication();
4040
4141 void destroyResources();
42−public Q_SLOTS:
43− // called by qtmir
44− void onScreenAboutToBeRemoved(QScreen *screen);
4542
4643private Q_SLOTS:
4744 void onScreenAdded(QScreen*);
45+ void onScreenRemoved(QScreen*);
4846
4947private:
5048 void setupQmlEngine(bool isMirServer);