Merge lp:~unity-team/qtmir/qtmir.api into lp:qtmir
- qtmir.api
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~unity-team/qtmir/qtmir.api |
Merge into: | lp:qtmir |
Prerequisite: | lp:~nick-dedekind/qtmir/miral-DisplayConfigurationStorage |
Diff against target: |
3478 lines (+1743/-612) 53 files modified
CMakeLists.txt (+3/-1) debian/changelog (+7/-0) debian/control (+29/-0) debian/gles-patches/convert-to-gles.patch (+27/-17) debian/libqtmirserver-dev.install (+3/-0) debian/libqtmirserver1.install (+1/-0) debian/qtmir-tests.install (+1/-1) debian/rules (+2/-0) demos/CMakeLists.txt (+1/-1) demos/qml-demo-client/main.cpp (+2/-2) demos/qml-demo-shell/CMakeLists.txt (+9/-0) demos/qml-demo-shell/main.cpp (+83/-10) include/qtmir/displayconfigurationpolicy.h (+70/-10) include/qtmir/displayconfigurationstorage.h (+61/-0) include/qtmir/miral/display_configuration_policy.h (+42/-0) include/qtmir/miral/display_configuration_storage.h (+6/-1) include/qtmir/mirserverapplication.h (+49/-0) include/qtmir/sessionauthorizer.h (+63/-20) include/qtmir/windowmanagementpolicy.h (+129/-0) src/modules/Unity/Application/CMakeLists.txt (+3/-1) src/modules/Unity/Application/taskcontroller.cpp (+1/-1) src/modules/Unity/Screens/CMakeLists.txt (+1/-1) src/platforms/mirserver/CMakeLists.txt (+103/-44) src/platforms/mirserver/displayconfigurationpolicy.cpp (+53/-39) src/platforms/mirserver/displayconfigurationstorage.cpp (+46/-0) src/platforms/mirserver/miral/CMakeLists.txt (+7/-2) src/platforms/mirserver/miral/display_configuration_policy.cpp (+21/-0) src/platforms/mirserver/miral/edid.cpp (+1/-1) src/platforms/mirserver/miral/persist_display_config.cpp (+57/-22) src/platforms/mirserver/miral/persist_display_config.h (+3/-4) src/platforms/mirserver/mirserverapplication.cpp (+53/-0) src/platforms/mirserver/mirserverintegration.cpp (+1/-1) src/platforms/mirserver/mirserverintegration.h (+2/-1) src/platforms/mirserver/qmirserver.cpp (+51/-0) src/platforms/mirserver/qmirserver.h (+24/-3) src/platforms/mirserver/qmirserver_p.cpp (+57/-16) src/platforms/mirserver/qmirserver_p.h (+12/-6) src/platforms/mirserver/qtmirserver.pc.in (+9/-0) src/platforms/mirserver/screensmodel.cpp (+1/-2) src/platforms/mirserver/windowcontroller.cpp (+2/-2) src/platforms/mirserver/windowcontroller.h (+4/-4) src/platforms/mirserver/wrappedsessionauthorizer.cpp (+134/-72) src/platforms/mirserver/wrappedsessionauthorizer.h (+39/-0) src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp (+446/-297) src/platforms/mirserver/wrappedwindowmanagementpolicy.h (+13/-22) tests/mirserver/EventBuilder/CMakeLists.txt (+1/-1) tests/mirserver/QtEventFeeder/CMakeLists.txt (+1/-1) tests/mirserver/Screen/CMakeLists.txt (+3/-1) tests/mirserver/ScreensModel/CMakeLists.txt (+1/-1) tests/mirserver/miral/CMakeLists.txt (+2/-2) tests/mirserver/miral/edid_test.cpp (+1/-1) tests/modules/Application/CMakeLists.txt (+1/-1) tests/modules/WindowManager/CMakeLists.txt (+1/-0) |
To merge this branch: | bzr merge lp:~unity-team/qtmir/qtmir.api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot (community) | continuous-integration | Approve | |
Gerry Boland (community) | Needs Fixing | ||
Daniel d'Andrada (community) | Abstain | ||
Michael Terry (community) | packaging | Needs Fixing | |
Review via email: mp+315681@code.launchpad.net |
Commit message
API for qtmir
Description of the change
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
- 625. By Nick Dedekind
-
merged parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:625
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Gerry Boland (gerboland) wrote : | # |
=== modified file 'debian/control'
+Package: qtmir-dev
I suspect qtmir will evolve into a more typical library in time. Can you rename to libqtmir-dev
+Replaces: qtmir-android-dev,
where did you find this package? qtmir never had a -dev package before.
Gerry Boland (gerboland) wrote : | # |
Copyrights need bumping to 2017
Gerry Boland (gerboland) wrote : | # |
== added file 'include/
+class GuiServerApplic
"Gui" is redundant here, I'd rather "MirServerAppli
Good work on establishing an API that is as flexible as MirAL's.
Gerry Boland (gerboland) wrote : | # |
+++ src/platforms/
last line
+}
missing a "// namespace qtmir"
+++ src/platforms/
+QSharedPointer
does it need to be shared?
around line 36, please add "// namespace" after the anonymous closing brace. And at EOF, another comment please. I get lost with namespaces.
+ : QGuiApplication
clever!
+++ src/platforms/
+ if (mode.size == newMode.size && mode.vrefresh_hz == newMode.
refresh_rate comparison is a floating point comparison, could be unreliable. Can you use something like qFuzzyCompare?
+++ src/platforms/
- QScopedPointer<
+ QSharedPointer<
Does it really need to be shared? AFAICS nobody else makes a copy of the QSharedPointer after construction.
+++ src/platforms/
+ static QSharedPointer<
+ char **argv);
It's your big entry point header file, make it pretty! Do line up these arguments, or just have on single line.
+++ src/platforms/
+auto buildDisplayCon
+-> std::shared_
I'm not a fan of this method definition style. Please stick to the old fashioned one.
Gerry Boland (gerboland) wrote : | # |
+++ src/platforms/
We need to standardize names. "qtmir" was never a great name, it is unclear if mir server or client. "qtmirserver" is ideal, but I know I am annoyed when the debian package name doesn't match the name used for the pkgconfig.
Should we call the debian package libqtmirserver then?
+Requires: miral
We should require miral version 1.1
Gerry Boland (gerboland) wrote : | # |
+ WrappedWindowMa
+ qtmir::
+ qtmir::
+ qtmir::AppNotifier &appNotifier,
+ const std::shared_
+ const qtmir::
Last two lines need & on the right, to be consistent
Michael Terry (mterry) wrote : | # |
Looking at the packaging...
+Package: qtmir-dev
This should probably be called libqtmirserver-dev instead.
+Replaces: qtmir-android-dev,
What's qtmir-android-dev from?
+Depends: qtmir-desktop (= ${source:Version}) | qtmir-android (= ${source:Version}),
I believe you want binary:Version here.
+Description: Developer files for the Qt platform abstraction plugin for a
+ Mir server.
+ .
+ Contains header files required for development using QtMir.
The first line of the description is special, don't break it across lines. I'd do something like:
Description: Header files for QtMir
QtMir is a set of Qt5 components to enable one to write a Mir server with Qt.
It contains a QPA (Qt Platform Abstraction) plugin which creates and manages
a Mir server. It also exposes some internal Mir functionality.
.
This package contains the library headers for developers.
Daniel d'Andrada (dandrader) wrote : | # |
There are conflicts with latest trunk.
"""
Text conflict in src/modules/
Text conflict in src/platforms/
Text conflict in src/platforms/
"""
- 626. By Nick Dedekind
-
merged trunk
- 627. By Nick Dedekind
-
packaging fixes
- 628. By Nick Dedekind
-
updated gles patch
- 629. By Nick Dedekind
-
GuiServerApplic
ation-> MirServerApplic ation - 630. By Nick Dedekind
-
comment updates
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:628
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:630
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : | # |
Merges fine now.
- 631. By Nick Dedekind
-
merged with parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:631
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 632. By Michael Zanetti
-
add a dep to libmiral-dev
Michael Zanetti (mzanetti) wrote : | # |
I've added a dep from to libqtmirserver-dev for libmiral-dev as pkgconfig for libqtmirserver requires that.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:632
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 633. By Nick Dedekind
-
libqtmirserver1
- 634. By Nick Dedekind
-
updated gles patch
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:634
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 635. By Nick Dedekind
-
merged with parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:635
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 636. By Nick Dedekind
-
merged with parent
- 637. By Nick Dedekind
-
removed appnotifier and window notifier
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:636
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:637
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 638. By Nick Dedekind
-
review comments
- 639. By Nick Dedekind
-
consistency
Nick Dedekind (nick-dedekind) wrote : | # |
> +++ src/platforms/
>
> last line
> +}
> missing a "// namespace qtmir"
>
>
> +++ src/platforms/
> +QSharedPointer
> does it need to be shared?
Both the QGuiApp and MirServerIntegr
>
> around line 36, please add "// namespace" after the anonymous closing brace.
> And at EOF, another comment please. I get lost with namespaces.
>
>
> + : QGuiApplication
> to ensure init called before QGuiApplication
> clever!
>
>
> +++ src/platforms/
> + if (mode.size == newMode.size && mode.vrefresh_hz == newMode.
> refresh_rate comparison is a floating point comparison, could be unreliable.
> Can you use something like qFuzzyCompare?
>
I've included qglobal and used qFuzzyCompare. Shouldn't really be doing that in the miral namespace. Mir doesn't seem to care about dodgey float compare :/
>
> +++ src/platforms/
> - QScopedPointer<
> + QSharedPointer<
> Does it really need to be shared? AFAICS nobody else makes a copy of the
> QSharedPointer after construction.
It's held by the MirServerApplic
>
>
> +++ src/platforms/
> + static QSharedPointer<
> + char **argv);
> It's your big entry point header file, make it pretty! Do line up these
> arguments, or just have on single line.
>
Done
>
> +++ src/platforms/
> +auto buildDisplayCon
> +-> std::shared_
> I'm not a fan of this method definition style. Please stick to the old
> fashioned one.
Done
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:639
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Gerry Boland (gerboland) wrote : | # |
+class BasicSetDisplay
+{
+public:
+ explicit BasicSetDisplay
+ ~BasicSetDispla
+
+ void operator(
You're making your life harder having the builder-applyer take QMirServer, instead of mir::Server. All of MirAL's building blocks use mir::Server, so if we go this route, we end up having to replace all of MirAL's bits. I think that's a bad idea.
Gerry Boland (gerboland) wrote : | # |
Ok, on further reflection I think I see why you've done that. Because you want to register that implementation with QMirServer, so that you can refer to it later (i.e. it doesn't disappear into the depths of Mir can we cannot get at it again).
Can MirAL give us more api maybe? /me needs to think
Albert Astals Cid (aacid) wrote : | # |
Text conflict in src/platforms/
Text conflict in src/platforms/
Text conflict in src/platforms/
3 conflicts encountered.
- 640. By Nick Dedekind
-
merged parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:640
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 641. By Nick Dedekind
-
added build dir to cmake path
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:641
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:641
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 642. By Nick Dedekind
-
merged with parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:642
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 643. By Nick Dedekind
-
reduce external WindowManagemen
tPolicy API
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:643
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 644. By Nick Dedekind
-
fixed miral include file
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:644
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unmerged revisions
- 644. By Nick Dedekind
-
fixed miral include file
- 643. By Nick Dedekind
-
reduce external WindowManagemen
tPolicy API - 642. By Nick Dedekind
-
merged with parent
- 641. By Nick Dedekind
-
added build dir to cmake path
- 640. By Nick Dedekind
-
merged parent
- 639. By Nick Dedekind
-
consistency
- 638. By Nick Dedekind
-
review comments
- 637. By Nick Dedekind
-
removed appnotifier and window notifier
- 636. By Nick Dedekind
-
merged with parent
- 635. By Nick Dedekind
-
merged with parent
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2017-03-24 11:29:56 +0000 |
3 | +++ CMakeLists.txt 2017-04-05 10:39:22 +0000 |
4 | @@ -3,9 +3,11 @@ |
5 | project(qtmir) |
6 | |
7 | set(QTMIR_VERSION_MAJOR 0) |
8 | -set(QTMIR_VERSION_MINOR 2) |
9 | +set(QTMIR_VERSION_MINOR 6) |
10 | set(QTMIR_VERSION_PATCH 0) |
11 | |
12 | +set(QTMIR_VERSION ${QTMIR_VERSION_MAJOR}.${QTMIR_VERSION_MINOR}.${QTMIR_VERSION_PATCH}) |
13 | + |
14 | if(${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
15 | message(FATAL_ERROR "In-tree build attempt detected, aborting. Set your build dir outside your source dir, delete CMakeCache.txt and CMakeFiles/ from source root and try again.") |
16 | endif() |
17 | |
18 | === modified file 'debian/changelog' |
19 | --- debian/changelog 2017-03-28 17:14:50 +0000 |
20 | +++ debian/changelog 2017-04-05 10:39:22 +0000 |
21 | @@ -1,3 +1,10 @@ |
22 | +qtmir (0.6.0) UNRELEASED; urgency=medium |
23 | + |
24 | + [ Nick Dedekind ] |
25 | + * Introduced QtMir API |
26 | + |
27 | + -- Nick Dedekind <nick.dedekind@canonical.com> Fri, 10 Feb 2017 09:09:09 +0000 |
28 | + |
29 | qtmir (0.5.1+17.04.20170328-0ubuntu1) zesty; urgency=medium |
30 | |
31 | [ Alan Griffiths ] |
32 | |
33 | === modified file 'debian/control' |
34 | --- debian/control 2017-03-24 11:29:56 +0000 |
35 | +++ debian/control 2017-04-05 10:39:22 +0000 |
36 | @@ -91,6 +91,35 @@ |
37 | . |
38 | This variant of the package is for GNU-based desktops. |
39 | |
40 | +Package: libqtmirserver-dev |
41 | +Section: libdevel |
42 | +Architecture: any |
43 | +Multi-Arch: same |
44 | +Pre-Depends: ${misc:Pre-Depends} |
45 | +Depends: qtmir-desktop (= ${binary:Version}) | qtmir-android (= ${binary:Version}), |
46 | + ${misc:Depends}, |
47 | + libmiral-dev (>= 1.3.0), |
48 | +Description: Developer files for QtMir server API |
49 | + QtMir is a set of Qt5 components to enable one to write a Mir server with Qt. |
50 | + It contains a QPA (Qt Platform Abstraction) plugin which creates and manages |
51 | + a Mir server. It also exposes some internal Mir functionality. |
52 | + . |
53 | + This package contains the library headers for developers. |
54 | + |
55 | +Package: libqtmirserver1 |
56 | +Section: libs |
57 | +Architecture: linux-any |
58 | +Multi-Arch: same |
59 | +Pre-Depends: ${misc:Pre-Depends} |
60 | +Depends: ${misc:Depends}, |
61 | + ${shlibs:Depends}, |
62 | +Description: QtMir server API shared library |
63 | + QtMir is a set of Qt5 components to enable one to write a Mir server with Qt. |
64 | + It contains a QPA (Qt Platform Abstraction) plugin which creates and manages |
65 | + a Mir server. It also exposes some internal Mir functionality. |
66 | + . |
67 | + Contains the shared library containing QtMir server API. |
68 | + |
69 | Package: qtdeclarative5-qtmir-plugin |
70 | Architecture: any |
71 | Multi-Arch: same |
72 | |
73 | === modified file 'debian/gles-patches/convert-to-gles.patch' |
74 | --- debian/gles-patches/convert-to-gles.patch 2017-03-07 14:10:10 +0000 |
75 | +++ debian/gles-patches/convert-to-gles.patch 2017-04-05 10:39:22 +0000 |
76 | @@ -1,15 +1,15 @@ |
77 | -Index: inline-gles-quilt/debian/control |
78 | +Index: qtmir.api/debian/control |
79 | =================================================================== |
80 | ---- inline-gles-quilt.orig/debian/control |
81 | -+++ inline-gles-quilt/debian/control |
82 | +--- qtmir.api.orig/debian/control |
83 | ++++ qtmir.api/debian/control |
84 | @@ -1,4 +1,4 @@ |
85 | -Source: qtmir |
86 | +Source: qtmir-gles |
87 | Section: libs |
88 | Priority: optional |
89 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
90 | -@@ -16,7 +16,13 @@ Build-Depends: cmake, |
91 | - libmirserver-dev (>= 0.24.0), |
92 | +@@ -19,7 +19,13 @@ Build-Depends: cmake, |
93 | + libmirserver-dev (>= 0.26.0), |
94 | libmtdev-dev, |
95 | libprocess-cpp-dev, |
96 | + libqt5gui5-gles, |
97 | @@ -21,8 +21,8 @@ |
98 | + libqt5test5, |
99 | libqtdbusmock1-dev (>= 0.2), |
100 | libqtdbustest1-dev (>= 0.2), |
101 | - libubuntu-app-launch2-dev, |
102 | -@@ -31,8 +37,8 @@ Build-Depends: cmake, |
103 | + libubuntu-app-launch3-dev, |
104 | +@@ -35,8 +41,8 @@ Build-Depends: cmake, |
105 | # lttng-gen-ts needs python3, but doesn't depend on it itself: bug 1359147 |
106 | python3:any, |
107 | qt5-default, |
108 | @@ -33,7 +33,7 @@ |
109 | qtdeclarative5-dev, |
110 | qtdeclarative5-private-dev, |
111 | quilt, |
112 | -@@ -45,7 +51,7 @@ Vcs-Bzr: lp:qtmir |
113 | +@@ -54,7 +60,7 @@ Vcs-Bzr: lp:qtmir |
114 | Vcs-Browser: http://bazaar.launchpad.net/~mir-team/qtmir/trunk/files |
115 | |
116 | Package: qtmir-android |
117 | @@ -42,7 +42,7 @@ |
118 | Multi-Arch: same |
119 | Conflicts: libqtmir, |
120 | qtmir-desktop, |
121 | -@@ -56,65 +62,10 @@ Replaces: libqtmir, |
122 | +@@ -65,30 +71,13 @@ Replaces: libqtmir, |
123 | Provides: qtmir, |
124 | Depends: ${misc:Depends}, |
125 | ${shlibs:Depends}, |
126 | @@ -71,7 +71,15 @@ |
127 | - a Mir server. It also exposes some internal Mir functionality. |
128 | - . |
129 | - This variant of the package is for GNU-based desktops. |
130 | -- |
131 | ++ This variant of the package is for Android-based phones and tablets (built |
132 | ++ against the OpenGLES variant of qtbase). |
133 | + |
134 | + Package: libqtmirserver-dev |
135 | + Section: libdevel |
136 | +@@ -118,40 +107,3 @@ Description: QtMir server API shared lib |
137 | + . |
138 | + Contains the shared library containing QtMir server API. |
139 | + |
140 | -Package: qtdeclarative5-qtmir-plugin |
141 | -Architecture: any |
142 | -Multi-Arch: same |
143 | @@ -109,20 +117,18 @@ |
144 | -Description: QtMir tests and demos |
145 | - This package provides benchmark tests and a simple shell and client using the |
146 | - QtMir QPA. |
147 | -+ This variant of the package is for Android-based phones and tablets (built |
148 | -+ against the OpenGLES variant of qtbase). |
149 | -Index: inline-gles-quilt/debian/rules |
150 | +Index: qtmir.api/debian/rules |
151 | =================================================================== |
152 | ---- inline-gles-quilt.orig/debian/rules |
153 | -+++ inline-gles-quilt/debian/rules |
154 | -@@ -3,66 +3,31 @@ |
155 | +--- qtmir.api.orig/debian/rules |
156 | ++++ qtmir.api/debian/rules |
157 | +@@ -3,68 +3,34 @@ |
158 | |
159 | export DPKG_GENSYMBOLS_CHECK_LEVEL=4 |
160 | |
161 | -include /usr/share/dpkg/default.mk |
162 | - |
163 | ANDROID_DIR = build-android |
164 | --DESKTOP_DIR = build-desktop |
165 | + DESKTOP_DIR = build-desktop |
166 | TMP1_DIR = $(CURDIR)/debian/tmp1 |
167 | -TMP2_DIR = $(CURDIR)/debian/tmp2 |
168 | - |
169 | @@ -183,3 +189,7 @@ |
170 | - dh_install --sourcedir=$(TMP2_DIR) -pqtmir-desktop |
171 | - dh_install --sourcedir=$(TMP2_DIR) -pqtdeclarative5-qtmir-plugin |
172 | - dh_install --sourcedir=$(TMP2_DIR) -pqtmir-tests |
173 | +- dh_install --sourcedir=$(TMP2_DIR) -plibqtmirserver1 |
174 | +- dh_install --sourcedir=$(TMP2_DIR) -plibqtmirserver-dev |
175 | ++ dh_install --sourcedir=$(TMP1_DIR) -plibqtmirserver1 |
176 | ++ dh_install --sourcedir=$(TMP1_DIR) -plibqtmirserver-dev |
177 | |
178 | === added file 'debian/libqtmirserver-dev.install' |
179 | --- debian/libqtmirserver-dev.install 1970-01-01 00:00:00 +0000 |
180 | +++ debian/libqtmirserver-dev.install 2017-04-05 10:39:22 +0000 |
181 | @@ -0,0 +1,3 @@ |
182 | +usr/include/qtmir |
183 | +usr/lib/*/pkgconfig/qtmirserver.pc |
184 | +usr/lib/*/libqtmirserver.so |
185 | |
186 | === added file 'debian/libqtmirserver1.install' |
187 | --- debian/libqtmirserver1.install 1970-01-01 00:00:00 +0000 |
188 | +++ debian/libqtmirserver1.install 2017-04-05 10:39:22 +0000 |
189 | @@ -0,0 +1,1 @@ |
190 | +usr/lib/*/libqtmirserver.so.1 |
191 | |
192 | === modified file 'debian/qtmir-tests.install' |
193 | --- debian/qtmir-tests.install 2015-10-27 15:56:28 +0000 |
194 | +++ debian/qtmir-tests.install 2017-04-05 10:39:22 +0000 |
195 | @@ -3,4 +3,4 @@ |
196 | usr/share/applications/qtmir-demo-client.desktop |
197 | usr/share/qtmir/benchmarks/* |
198 | usr/share/qtmir/qtmir-demo-client/* |
199 | -usr/share/qtmir/qtmir-demo-shell/ |
200 | +usr/share/qtmir/qtmir-demo-shell/* |
201 | |
202 | === modified file 'debian/rules' |
203 | --- debian/rules 2016-11-23 19:46:24 +0000 |
204 | +++ debian/rules 2017-04-05 10:39:22 +0000 |
205 | @@ -66,3 +66,5 @@ |
206 | dh_install --sourcedir=$(TMP2_DIR) -pqtmir-desktop |
207 | dh_install --sourcedir=$(TMP2_DIR) -pqtdeclarative5-qtmir-plugin |
208 | dh_install --sourcedir=$(TMP2_DIR) -pqtmir-tests |
209 | + dh_install --sourcedir=$(TMP2_DIR) -plibqtmirserver1 |
210 | + dh_install --sourcedir=$(TMP2_DIR) -plibqtmirserver-dev |
211 | |
212 | === modified file 'demos/CMakeLists.txt' |
213 | --- demos/CMakeLists.txt 2015-09-01 16:16:47 +0000 |
214 | +++ demos/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
215 | @@ -1,4 +1,4 @@ |
216 | configure_file(paths.h.in ${CMAKE_CURRENT_BINARY_DIR}/paths.h @ONLY) |
217 | |
218 | add_subdirectory(qml-demo-client) |
219 | -add_subdirectory(qml-demo-shell) |
220 | \ No newline at end of file |
221 | +add_subdirectory(qml-demo-shell) |
222 | |
223 | === modified file 'demos/qml-demo-client/main.cpp' |
224 | --- demos/qml-demo-client/main.cpp 2015-09-17 11:20:00 +0000 |
225 | +++ demos/qml-demo-client/main.cpp 2017-04-05 10:39:22 +0000 |
226 | @@ -57,8 +57,8 @@ |
227 | view->setResizeMode(QQuickView::SizeRootObjectToView); |
228 | view->setColor("black"); |
229 | view->setTitle("Demo Client"); |
230 | - |
231 | - QUrl source(::qmlDirectory() + "qtmir-demo-client/qml-demo-client.qml"); |
232 | + |
233 | + QUrl source(::qmlDirectory() + "qml-demo-client/qml-demo-client.qml"); |
234 | |
235 | view->setSource(source); |
236 | QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit())); |
237 | |
238 | === modified file 'demos/qml-demo-shell/CMakeLists.txt' |
239 | --- demos/qml-demo-shell/CMakeLists.txt 2016-11-07 18:26:47 +0000 |
240 | +++ demos/qml-demo-shell/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
241 | @@ -2,6 +2,12 @@ |
242 | |
243 | include_directories( |
244 | SYSTEM |
245 | + |
246 | + ${CMAKE_SOURCE_DIR}/include |
247 | + |
248 | + ${MIRSERVER_INCLUDE_DIRS} |
249 | + ${MIRAL_INCLUDE_DIRS} |
250 | + |
251 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
252 | ${Qt5Qml_PRIVATE_INCLUDE_DIRS} |
253 | ${Qt5Quick_PRIVATE_INCLUDE_DIRS} |
254 | @@ -14,6 +20,9 @@ |
255 | |
256 | target_link_libraries( |
257 | ${DEMO_SHELL} |
258 | + |
259 | + qtmirserver |
260 | + |
261 | Qt5::Core |
262 | Qt5::DBus |
263 | Qt5::Qml |
264 | |
265 | === modified file 'demos/qml-demo-shell/main.cpp' |
266 | --- demos/qml-demo-shell/main.cpp 2016-11-03 20:17:46 +0000 |
267 | +++ demos/qml-demo-shell/main.cpp 2017-04-05 10:39:22 +0000 |
268 | @@ -22,27 +22,100 @@ |
269 | #include <QDebug> |
270 | #include <libintl.h> |
271 | #include "../paths.h" |
272 | - |
273 | #include "pointerposition.h" |
274 | |
275 | -// REMOVEME - Should be able to use qmlscene, but in order to use the mir benchmarking we need |
276 | -// to parse command line switches. Wait until MIR_SOCKET supported by the benchmark framework. |
277 | +#include <qtmir/mirserverapplication.h> |
278 | +#include <qtmir/displayconfigurationpolicy.h> |
279 | +#include <qtmir/sessionauthorizer.h> |
280 | +#include <qtmir/windowmanagementpolicy.h> |
281 | +#include <qtmir/displayconfigurationstorage.h> |
282 | + |
283 | +struct DemoDisplayConfigurationPolicy : qtmir::DisplayConfigurationPolicy |
284 | +{ |
285 | + void apply_to(mir::graphics::DisplayConfiguration& conf) |
286 | + { |
287 | + qDebug() << "OVERRIDE qtmir::DisplayConfigurationPolicy::apply_to"; |
288 | + qtmir::DisplayConfigurationPolicy::apply_to(conf); |
289 | + } |
290 | +}; |
291 | + |
292 | +class DemoWindowManagementPolicy : public qtmir::WindowManagementPolicy |
293 | +{ |
294 | +public: |
295 | + DemoWindowManagementPolicy(const miral::WindowManagerTools &tools, std::shared_ptr<qtmir::WindowManagementPolicyPrivate> dd) |
296 | + : qtmir::WindowManagementPolicy(tools, dd) |
297 | + {} |
298 | + |
299 | + bool handle_keyboard_event(const MirKeyboardEvent *event) override |
300 | + { |
301 | + qDebug() << "OVERRIDE qtmir::WindowManagementPolicy::handle_keyboard_event" << event; |
302 | + return qtmir::WindowManagementPolicy::handle_keyboard_event(event); |
303 | + } |
304 | +}; |
305 | + |
306 | +struct DemoDisplayConfigurationStorage : miral::DisplayConfigurationStorage |
307 | +{ |
308 | + void save(const miral::DisplayId&, const miral::DisplayConfigurationOptions&) override |
309 | + { |
310 | + qDebug() << "OVERRIDE miral::DisplayConfigurationStorage::save"; |
311 | + } |
312 | + |
313 | + bool load(const miral::DisplayId&, miral::DisplayConfigurationOptions&) const override |
314 | + { |
315 | + qDebug() << "OVERRIDE miral::DisplayConfigurationStorage::load"; |
316 | + return false; |
317 | + } |
318 | +}; |
319 | + |
320 | +struct DemoSessionAuthorizer : qtmir::SessionAuthorizer |
321 | +{ |
322 | + bool connectionIsAllowed(miral::ApplicationCredentials const& creds) override |
323 | + { |
324 | + qDebug() << "OVERRIDE qtmir::SessionAuthorizer::connectionIsAllowed"; |
325 | + return qtmir::SessionAuthorizer::connectionIsAllowed(creds); |
326 | + } |
327 | + bool configureDisplayIsAllowed(miral::ApplicationCredentials const& creds) override |
328 | + { |
329 | + qDebug() << "OVERRIDE qtmir::SessionAuthorizer::configureDisplayIsAllowed"; |
330 | + return qtmir::SessionAuthorizer::configureDisplayIsAllowed(creds); |
331 | + } |
332 | + bool setBaseDisplayConfigurationIsAllowed(miral::ApplicationCredentials const& creds) override |
333 | + { |
334 | + qDebug() << "OVERRIDE qtmir::SessionAuthorizer::setBaseDisplayConfigurationIsAllowed"; |
335 | + return qtmir::SessionAuthorizer::setBaseDisplayConfigurationIsAllowed(creds); |
336 | + } |
337 | + bool screencastIsAllowed(miral::ApplicationCredentials const& creds) override |
338 | + { |
339 | + qDebug() << "OVERRIDE qtmir::SessionAuthorizer::screencastIsAllowed"; |
340 | + return qtmir::SessionAuthorizer::screencastIsAllowed(creds); |
341 | + } |
342 | + bool promptSessionIsAllowed(miral::ApplicationCredentials const& creds) override |
343 | + { |
344 | + qDebug() << "OVERRIDE qtmir::SessionAuthorizer::promptSessionIsAllowed"; |
345 | + return qtmir::SessionAuthorizer::promptSessionIsAllowed(creds); |
346 | + } |
347 | +}; |
348 | |
349 | int main(int argc, const char *argv[]) |
350 | { |
351 | + qtmir::SetSessionAuthorizer<DemoSessionAuthorizer> sessionAuth; |
352 | + qtmir::SetDisplayConfigurationPolicy<DemoDisplayConfigurationPolicy> displayConfig; |
353 | + qtmir::SetWindowManagementPolicy<DemoWindowManagementPolicy> wmPolicy; |
354 | + |
355 | + qtmir::SetDisplayConfigurationStorage<DemoDisplayConfigurationStorage> displayStorage; |
356 | + |
357 | setenv("QT_QPA_PLATFORM_PLUGIN_PATH", qPrintable(::qpaPluginDirectory()), 1 /* overwrite */); |
358 | - setenv("QT_QPA_PLATFORM", "mirserver", 1 /* overwrite */); |
359 | - |
360 | - QGuiApplication::setApplicationName("qml-demo-shell"); |
361 | - QGuiApplication *application; |
362 | - |
363 | - application = new QGuiApplication(argc, (char**)argv); |
364 | + |
365 | + qtmir::MirServerApplication::setApplicationName("api-demo-shell"); |
366 | + qtmir::MirServerApplication *application; |
367 | + |
368 | + application = new qtmir::MirServerApplication(argc, (char**)argv, { displayConfig, sessionAuth, wmPolicy, displayStorage }); |
369 | QQuickView* view = new QQuickView(); |
370 | view->engine()->addImportPath(::qmlPluginDirectory()); |
371 | view->setResizeMode(QQuickView::SizeRootObjectToView); |
372 | view->setColor("lightgray"); |
373 | view->setTitle("Demo Shell"); |
374 | - |
375 | + |
376 | qmlRegisterSingletonType<PointerPosition>("Mir.Pointer", 0, 1, "PointerPosition", |
377 | [](QQmlEngine*, QJSEngine*) -> QObject* { return PointerPosition::instance(); }); |
378 | |
379 | |
380 | === added directory 'include' |
381 | === added directory 'include/qtmir' |
382 | === renamed file 'src/platforms/mirserver/mirdisplayconfigurationpolicy.h' => 'include/qtmir/displayconfigurationpolicy.h' |
383 | --- src/platforms/mirserver/mirdisplayconfigurationpolicy.h 2017-01-05 14:36:10 +0000 |
384 | +++ include/qtmir/displayconfigurationpolicy.h 2017-04-05 10:39:22 +0000 |
385 | @@ -1,5 +1,5 @@ |
386 | /* |
387 | - * Copyright (C) 2015-2016 Canonical, Ltd. |
388 | + * Copyright (C) 2016 Canonical, Ltd. |
389 | * |
390 | * This program is free software: you can redistribute it and/or modify it under |
391 | * the terms of the GNU Lesser General Public License version 3, as published by |
392 | @@ -14,19 +14,79 @@ |
393 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
394 | */ |
395 | |
396 | -#ifndef MIRDISPLAYCONFIGURATIONPOLICY_H |
397 | -#define MIRDISPLAYCONFIGURATIONPOLICY_H |
398 | +#ifndef QTMIR_DISPLAYCONFIGURATIONPOLICY_H |
399 | +#define QTMIR_DISPLAYCONFIGURATIONPOLICY_H |
400 | + |
401 | +//qtmir |
402 | +#include "qtmir/miral/display_configuration_policy.h" |
403 | + |
404 | +// mir |
405 | +#include <mir/server.h> |
406 | |
407 | #include <memory> |
408 | |
409 | -namespace mir { namespace graphics { class DisplayConfigurationPolicy; }} |
410 | +class QMirServer; |
411 | |
412 | namespace qtmir |
413 | { |
414 | |
415 | -auto wrapDisplayConfigurationPolicy(const std::shared_ptr<mir::graphics::DisplayConfigurationPolicy> &wrapped) |
416 | --> std::shared_ptr<mir::graphics::DisplayConfigurationPolicy>; |
417 | -} |
418 | - |
419 | - |
420 | -#endif // MIRDISPLAYCONFIGURATIONPOLICY_H |
421 | +/* |
422 | + Provides callback for display configuration customization. |
423 | + |
424 | + This default policy applies scaling and form factor decisions on the configuration. |
425 | + It can be subclassed/overriden by using the SetDisplayConfigurationPolicy<> initializer. |
426 | + |
427 | + usage: |
428 | + struct MyDisplayConfigurationPolicy : qtmir::DisplayConfigurationPolicy |
429 | + { |
430 | + void apply_to(mir::graphics::DisplayConfiguration& conf) override; |
431 | + } |
432 | + |
433 | + qtmir::GuiServerApplication app(argc, argv, { SetDisplayConfigurationPolicy<MyDisplayConfigurationPolicy>() }); |
434 | + */ |
435 | +class DisplayConfigurationPolicy : public miral::DisplayConfigurationPolicy |
436 | +{ |
437 | +public: |
438 | + DisplayConfigurationPolicy(); |
439 | + |
440 | + virtual void apply_to(mir::graphics::DisplayConfiguration& conf) override; |
441 | + |
442 | +private: |
443 | + struct Private; |
444 | + std::shared_ptr<Private> d; |
445 | +}; |
446 | + |
447 | +using DisplayConfigurationPolicyWrapper = std::function<std::shared_ptr<miral::DisplayConfigurationPolicy>()>; |
448 | + |
449 | +/* |
450 | + Base class for access to set the display configuration policy |
451 | + */ |
452 | +class BasicSetDisplayConfigurationPolicy |
453 | +{ |
454 | +public: |
455 | + explicit BasicSetDisplayConfigurationPolicy(DisplayConfigurationPolicyWrapper const& builder); |
456 | + ~BasicSetDisplayConfigurationPolicy() = default; |
457 | + |
458 | + void operator()(QMirServer& server); |
459 | + |
460 | +private: |
461 | + struct Self; |
462 | + std::shared_ptr<Self> self; |
463 | +}; |
464 | + |
465 | +/* |
466 | + Set the display configuration policy to allow server customization |
467 | + */ |
468 | +template<typename Policy> |
469 | +class SetDisplayConfigurationPolicy : public BasicSetDisplayConfigurationPolicy |
470 | +{ |
471 | +public: |
472 | + template<typename ...Args> |
473 | + explicit SetDisplayConfigurationPolicy(Args const& ...args) : |
474 | + BasicSetDisplayConfigurationPolicy{ |
475 | + [&args...]() { return std::make_shared<Policy>(args...); }} {} |
476 | +}; |
477 | + |
478 | +} // namespace qtmir |
479 | + |
480 | +#endif // QTMIR_DISPLAYCONFIGURATIONPOLICY_H |
481 | |
482 | === added file 'include/qtmir/displayconfigurationstorage.h' |
483 | --- include/qtmir/displayconfigurationstorage.h 1970-01-01 00:00:00 +0000 |
484 | +++ include/qtmir/displayconfigurationstorage.h 2017-04-05 10:39:22 +0000 |
485 | @@ -0,0 +1,61 @@ |
486 | +/* |
487 | + * Copyright (C) 2017 Canonical, Ltd. |
488 | + * |
489 | + * This program is free software: you can redistribute it and/or modify it under |
490 | + * the terms of the GNU Lesser General Public License version 3, as published by |
491 | + * the Free Software Foundation. |
492 | + * |
493 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
494 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
495 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
496 | + * Lesser General Public License for more details. |
497 | + * |
498 | + * You should have received a copy of the GNU Lesser General Public License |
499 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
500 | + */ |
501 | + |
502 | +#ifndef DISPLAYCONFIGURATIONSTORAGE_H |
503 | +#define DISPLAYCONFIGURATIONSTORAGE_H |
504 | + |
505 | +#include "qtmir/miral/display_configuration_storage.h" |
506 | + |
507 | +#include <functional> |
508 | +#include <memory> |
509 | + |
510 | +class QMirServer; |
511 | + |
512 | +namespace qtmir |
513 | +{ |
514 | + |
515 | +using DisplayConfigurationStorageBuilder = std::function<std::shared_ptr<miral::DisplayConfigurationStorage>()>; |
516 | + |
517 | +class BasicSetDisplayConfigurationStorage |
518 | +{ |
519 | +public: |
520 | + explicit BasicSetDisplayConfigurationStorage(DisplayConfigurationStorageBuilder const& builder); |
521 | + ~BasicSetDisplayConfigurationStorage() = default; |
522 | + |
523 | + void operator()(QMirServer& server); |
524 | + DisplayConfigurationStorageBuilder builder() const; |
525 | + |
526 | +private: |
527 | + struct Self; |
528 | + std::shared_ptr<Self> self; |
529 | +}; |
530 | + |
531 | +/* |
532 | + Set the display configuration policy to allow server customization |
533 | + */ |
534 | +template<typename Policy> |
535 | +class SetDisplayConfigurationStorage : public BasicSetDisplayConfigurationStorage |
536 | +{ |
537 | +public: |
538 | + template<typename ...Args> |
539 | + explicit SetDisplayConfigurationStorage(Args const& ...args) : |
540 | + BasicSetDisplayConfigurationStorage{ |
541 | + [&args...]() { return std::make_shared<Policy>(args...); }} {} |
542 | +}; |
543 | + |
544 | +} |
545 | + |
546 | +#endif // DISPLAYCONFIGURATIONSTORAGE_H |
547 | |
548 | === added directory 'include/qtmir/miral' |
549 | === added file 'include/qtmir/miral/display_configuration_policy.h' |
550 | --- include/qtmir/miral/display_configuration_policy.h 1970-01-01 00:00:00 +0000 |
551 | +++ include/qtmir/miral/display_configuration_policy.h 2017-04-05 10:39:22 +0000 |
552 | @@ -0,0 +1,42 @@ |
553 | +/* |
554 | + * Copyright © 2016 Canonical Ltd. |
555 | + * |
556 | + * This program is free software: you can redistribute it and/or modify it |
557 | + * under the terms of the GNU General Public License version 3, |
558 | + * as published by the Free Software Foundation. |
559 | + * |
560 | + * This program is distributed in the hope that it will be useful, |
561 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
562 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
563 | + * GNU General Public License for more details. |
564 | + * |
565 | + * You should have received a copy of the GNU General Public License |
566 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
567 | + * |
568 | + * Authored by: Nick Dedekind <nick.dedekind@canonical.com> |
569 | + */ |
570 | + |
571 | +#ifndef MIRAL_DISPLAY_CONDIFIGURATION_POLICY_H |
572 | +#define MIRAL_DISPLAY_CONDIFIGURATION_POLICY_H |
573 | + |
574 | +namespace mir { namespace graphics { class DisplayConfiguration; } } |
575 | + |
576 | +namespace miral |
577 | +{ |
578 | + |
579 | +class DisplayConfigurationPolicy |
580 | +{ |
581 | +public: |
582 | + DisplayConfigurationPolicy(); |
583 | + |
584 | + virtual ~DisplayConfigurationPolicy() = default; |
585 | + DisplayConfigurationPolicy(DisplayConfigurationPolicy const&) = delete; |
586 | + DisplayConfigurationPolicy& operator=(DisplayConfigurationPolicy const&) = delete; |
587 | + |
588 | + virtual void apply_to(mir::graphics::DisplayConfiguration& conf) = 0; |
589 | +}; |
590 | + |
591 | +} // namespace miral |
592 | + |
593 | + |
594 | +#endif // MIRAL_DISPLAY_CONDIFIGURATION_POLICY_H |
595 | |
596 | === renamed file 'src/platforms/mirserver/miral/display_configuration_storage.h' => 'include/qtmir/miral/display_configuration_storage.h' |
597 | --- src/platforms/mirserver/miral/display_configuration_storage.h 2017-04-05 10:39:22 +0000 |
598 | +++ include/qtmir/miral/display_configuration_storage.h 2017-04-05 10:39:22 +0000 |
599 | @@ -39,7 +39,12 @@ |
600 | { |
601 | mir::optional_value<bool> used; |
602 | mir::optional_value<uint> clone_output_index; |
603 | - mir::optional_value<mir::geometry::Size> size; |
604 | + struct DisplayMode |
605 | + { |
606 | + mir::geometry::Size size; |
607 | + double refresh_rate{-1}; |
608 | + }; |
609 | + mir::optional_value<DisplayMode> mode; |
610 | mir::optional_value<MirOrientation> orientation; |
611 | mir::optional_value<MirFormFactor> form_factor; |
612 | mir::optional_value<float> scale; |
613 | |
614 | === renamed file 'src/platforms/mirserver/miral/edid.h' => 'include/qtmir/miral/edid.h' |
615 | === added file 'include/qtmir/mirserverapplication.h' |
616 | --- include/qtmir/mirserverapplication.h 1970-01-01 00:00:00 +0000 |
617 | +++ include/qtmir/mirserverapplication.h 2017-04-05 10:39:22 +0000 |
618 | @@ -0,0 +1,49 @@ |
619 | +/* |
620 | + * Copyright (C) 2017 Canonical, Ltd. |
621 | + * |
622 | + * This program is free software: you can redistribute it and/or modify it under |
623 | + * the terms of the GNU Lesser General Public License version 3, as published by |
624 | + * the Free Software Foundation. |
625 | + * |
626 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
627 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
628 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
629 | + * Lesser General Public License for more details. |
630 | + * |
631 | + * You should have received a copy of the GNU Lesser General Public License |
632 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
633 | + */ |
634 | + |
635 | +#ifndef QTMIR_MIRSERVERAPPLICATION_H |
636 | +#define QTMIR_MIRSERVERAPPLICATION_H |
637 | + |
638 | +#include <QtGui/QGuiApplication> |
639 | + |
640 | +// std |
641 | +#include <functional> |
642 | + |
643 | +class QMirServer; |
644 | + |
645 | +namespace qtmir { |
646 | + |
647 | +class WindowModelNotifier; |
648 | +class AppNotifier; |
649 | + |
650 | +class MirServerApplication : public QGuiApplication |
651 | +{ |
652 | + Q_OBJECT |
653 | + |
654 | +public: |
655 | + explicit MirServerApplication(int &argc, |
656 | + char **argv, |
657 | + std::initializer_list<std::function<void(QMirServer&)>> options); |
658 | + ~MirServerApplication(); |
659 | + |
660 | +Q_SIGNALS: |
661 | + // invoked by screen model |
662 | + void screenAboutToBeRemoved(QScreen *screen); |
663 | +}; |
664 | + |
665 | +} // namespace qtmir |
666 | + |
667 | +#endif // QTMIR_MIRSERVERAPPLICATION_H |
668 | |
669 | === renamed file 'src/platforms/mirserver/sessionauthorizer.h' => 'include/qtmir/sessionauthorizer.h' |
670 | --- src/platforms/mirserver/sessionauthorizer.h 2016-11-03 20:17:46 +0000 |
671 | +++ include/qtmir/sessionauthorizer.h 2017-04-05 10:39:22 +0000 |
672 | @@ -1,5 +1,5 @@ |
673 | /* |
674 | - * Copyright (C) 2013-2015 Canonical, Ltd. |
675 | + * Copyright (C) 2016 Canonical, Ltd. |
676 | * |
677 | * This program is free software: you can redistribute it and/or modify it under |
678 | * the terms of the GNU Lesser General Public License version 3, as published by |
679 | @@ -14,38 +14,81 @@ |
680 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
681 | */ |
682 | |
683 | -#ifndef SESSIONAUTHORIZER_H |
684 | -#define SESSIONAUTHORIZER_H |
685 | +#ifndef QTMIR_SESSIONAUTHORIZER_H |
686 | +#define QTMIR_SESSIONAUTHORIZER_H |
687 | |
688 | -//std |
689 | -#include <string> |
690 | +// Qt |
691 | +#include <QObject> |
692 | |
693 | // mir |
694 | #include <miral/application_authorizer.h> |
695 | |
696 | -// Qt |
697 | -#include <QObject> |
698 | - |
699 | -class SessionAuthorizer : public QObject, public miral::ApplicationAuthorizer |
700 | +class QMirServer; |
701 | + |
702 | +namespace qtmir { |
703 | + |
704 | +/* |
705 | + Provides callbacks to grant/deny access for session capabilities |
706 | + */ |
707 | +class SessionAuthorizer : public QObject |
708 | { |
709 | Q_OBJECT |
710 | - |
711 | public: |
712 | - SessionAuthorizer(QObject *parent = 0); |
713 | + SessionAuthorizer(); |
714 | ~SessionAuthorizer(); |
715 | |
716 | - bool connection_is_allowed(miral::ApplicationCredentials const& creds) override; |
717 | - bool configure_display_is_allowed(miral::ApplicationCredentials const& creds) override; |
718 | - bool set_base_display_configuration_is_allowed(miral::ApplicationCredentials const& creds) override; |
719 | - bool screencast_is_allowed(miral::ApplicationCredentials const& creds) override; |
720 | - bool prompt_session_is_allowed(miral::ApplicationCredentials const& creds) override; |
721 | + virtual bool connectionIsAllowed(miral::ApplicationCredentials const& creds); |
722 | + virtual bool configureDisplayIsAllowed(miral::ApplicationCredentials const& creds); |
723 | + virtual bool setBaseDisplayConfigurationIsAllowed(miral::ApplicationCredentials const& creds); |
724 | + virtual bool screencastIsAllowed(miral::ApplicationCredentials const& creds); |
725 | + virtual bool promptSessionIsAllowed(miral::ApplicationCredentials const& creds); |
726 | |
727 | Q_SIGNALS: |
728 | // needs to be blocked queued signal which returns value for authorized |
729 | void requestAuthorizationForSession(const pid_t &pid, bool &authorized); |
730 | |
731 | private: |
732 | - bool m_connectionChecked; |
733 | -}; |
734 | - |
735 | -#endif // SESSIONAUTHORIZER_H |
736 | + struct Private; |
737 | + std::shared_ptr<Private> d; |
738 | +}; |
739 | + |
740 | +using SessionAuthorizerBuilder = |
741 | + std::function<std::shared_ptr<SessionAuthorizer>()>; |
742 | + |
743 | +class BasicSetSessionAuthorizer |
744 | +{ |
745 | +public: |
746 | + explicit BasicSetSessionAuthorizer(SessionAuthorizerBuilder const& builder); |
747 | + ~BasicSetSessionAuthorizer() = default; |
748 | + |
749 | + void operator()(QMirServer& server); |
750 | + SessionAuthorizerBuilder builder() const; |
751 | + |
752 | +private: |
753 | + struct Private; |
754 | + std::shared_ptr<Private> d; |
755 | +}; |
756 | + |
757 | +/* |
758 | + Set the session authorizer to allow server customization |
759 | + |
760 | + usage: |
761 | + class MySessionAuthorizer : publi qtmir::SessionAuthorizer |
762 | + { |
763 | + ... |
764 | + } |
765 | + |
766 | + qtmir::GuiServerApplication app(argc, argv, { SetSessionAuthorizer<MySessionAuthorizer>() }); |
767 | + */ |
768 | +template<typename Policy> |
769 | +class SetSessionAuthorizer : public BasicSetSessionAuthorizer |
770 | +{ |
771 | +public: |
772 | + template<typename ...Args> |
773 | + explicit SetSessionAuthorizer(Args const& ...args) : |
774 | + BasicSetSessionAuthorizer{[&args...]() { return std::make_shared<Policy>(args...); }} {} |
775 | +}; |
776 | + |
777 | +} // namespace qtmir |
778 | + |
779 | +#endif // QTMIR_SESSIONAUTHORIZER_H |
780 | |
781 | === added file 'include/qtmir/windowmanagementpolicy.h' |
782 | --- include/qtmir/windowmanagementpolicy.h 1970-01-01 00:00:00 +0000 |
783 | +++ include/qtmir/windowmanagementpolicy.h 2017-04-05 10:39:22 +0000 |
784 | @@ -0,0 +1,129 @@ |
785 | +/* |
786 | + * Copyright (C) 2017 Canonical, Ltd. |
787 | + * |
788 | + * This program is free software: you can redistribute it and/or modify it under |
789 | + * the terms of the GNU Lesser General Public License version 3, as published by |
790 | + * the Free Software Foundation. |
791 | + * |
792 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
793 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
794 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
795 | + * Lesser General Public License for more details. |
796 | + * |
797 | + * You should have received a copy of the GNU Lesser General Public License |
798 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
799 | + */ |
800 | + |
801 | +#ifndef QTMIR_WINDOWMANAGEMENTPOLICY_H |
802 | +#define QTMIR_WINDOWMANAGEMENTPOLICY_H |
803 | + |
804 | +// miral |
805 | +#include "miral/canonical_window_manager.h" |
806 | +#include <miral/version.h> |
807 | +#if MIRAL_VERSION > MIR_VERSION_NUMBER(1,3,1) |
808 | +#include <miral/set_window_management_policy.h> |
809 | +#else |
810 | +#include <miral/set_window_managment_policy.h> |
811 | +#endif |
812 | + |
813 | +// Unity API |
814 | +#include <unity/shell/application/Mir.h> |
815 | + |
816 | +using namespace mir::geometry; |
817 | + |
818 | +class QMirServer; |
819 | +class QMargins; |
820 | + |
821 | +namespace qtmir { |
822 | + |
823 | +class WindowModelNotifier; |
824 | +class AppNotifier; |
825 | +class WindowManagementPolicyPrivate; |
826 | + |
827 | +/* |
828 | + Provides window management callbacks for window behaviour customization |
829 | + */ |
830 | +class WindowManagementPolicy : public miral::CanonicalWindowManagerPolicy |
831 | +{ |
832 | +public: |
833 | + |
834 | + // From miral::WindowManagementPolicy |
835 | + auto place_new_window(const miral::ApplicationInfo &app_info, |
836 | + const miral::WindowSpecification &request_parameters) |
837 | + -> miral::WindowSpecification override; |
838 | + |
839 | + void handle_window_ready(miral::WindowInfo &windowInfo) override; |
840 | + void handle_modify_window( |
841 | + :: miral::WindowInfo &windowInfo, |
842 | + const miral::WindowSpecification &modifications) override; |
843 | + void handle_raise_window(miral::WindowInfo &windowInfo) override; |
844 | + |
845 | + bool handle_keyboard_event(const MirKeyboardEvent *event) override; |
846 | + bool handle_touch_event(const MirTouchEvent *event) override; |
847 | + bool handle_pointer_event(const MirPointerEvent *event) override; |
848 | + |
849 | + void advise_begin() override; |
850 | + void advise_end() override; |
851 | + |
852 | + void advise_new_app(miral::ApplicationInfo &application) override; |
853 | + void advise_delete_app(const miral::ApplicationInfo &application) override; |
854 | + |
855 | + void advise_new_window(const miral::WindowInfo &windowInfo) override; |
856 | + void advise_focus_lost(const miral::WindowInfo &info) override; |
857 | + void advise_focus_gained(const miral::WindowInfo &info) override; |
858 | + void advise_state_change(const miral::WindowInfo &info, MirWindowState state) override; |
859 | + void advise_move_to(const:: miral::WindowInfo &windowInfo, Point topLeft) override; |
860 | + void advise_resize(const miral::WindowInfo &info, const Size &newSize) override; |
861 | + void advise_delete_window(const miral::WindowInfo &windowInfo) override; |
862 | + void advise_raise(const std::vector<miral::Window> &windows) override; |
863 | + |
864 | + Rectangle confirm_inherited_move(miral::WindowInfo const& windowInfo, Displacement movement) override; |
865 | + |
866 | +protected: |
867 | + WindowManagementPolicy(const miral::WindowManagerTools &tools, std::shared_ptr<qtmir::WindowManagementPolicyPrivate> dd); |
868 | + |
869 | + std::shared_ptr<WindowManagementPolicyPrivate> d; |
870 | +}; |
871 | + |
872 | +using WindowManagmentPolicyBuilder = |
873 | + std::function<std::shared_ptr<WindowManagementPolicy>(const miral::WindowManagerTools &tools, std::shared_ptr<qtmir::WindowManagementPolicyPrivate> dd)>; |
874 | + |
875 | +class BasicSetWindowManagementPolicy |
876 | +{ |
877 | +public: |
878 | + explicit BasicSetWindowManagementPolicy(WindowManagmentPolicyBuilder const& builder); |
879 | + ~BasicSetWindowManagementPolicy() = default; |
880 | + |
881 | + void operator()(QMirServer& server); |
882 | + WindowManagmentPolicyBuilder builder() const; |
883 | + |
884 | +private: |
885 | + struct Private; |
886 | + std::shared_ptr<Private> d; |
887 | +}; |
888 | + |
889 | +/* |
890 | + Set the window management policy to allow server customization |
891 | + |
892 | + usage: |
893 | + class MyWindowManagementPolicy : publi qtmir::WindowManagementPolicy |
894 | + { |
895 | + ... |
896 | + } |
897 | + |
898 | + qtmir::GuiServerApplication app(argc, argv, { SetWindowManagementPolicy<MyWindowManagementPolicy>() }); |
899 | + */ |
900 | +template<typename Policy> |
901 | +class SetWindowManagementPolicy : public BasicSetWindowManagementPolicy |
902 | +{ |
903 | +public: |
904 | + template<typename ...Args> |
905 | + explicit SetWindowManagementPolicy(Args const& ...args) : |
906 | + BasicSetWindowManagementPolicy{[&args...](const miral::WindowManagerTools &tools, std::shared_ptr<qtmir::WindowManagementPolicyPrivate> dd) { |
907 | + return std::make_shared<Policy>(tools, dd, args...); |
908 | + }} {} |
909 | +}; |
910 | + |
911 | +} // namespace qtmir |
912 | + |
913 | +#endif // QTMIR_WINDOWMANAGEMENTPOLICY_H |
914 | |
915 | === modified file 'src/modules/Unity/Application/CMakeLists.txt' |
916 | --- src/modules/Unity/Application/CMakeLists.txt 2017-03-13 16:49:49 +0000 |
917 | +++ src/modules/Unity/Application/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
918 | @@ -1,6 +1,8 @@ |
919 | include_directories( |
920 | + ${CMAKE_SOURCE_DIR}/include |
921 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
922 | ${CMAKE_SOURCE_DIR}/src/common |
923 | + ${CMAKE_CURRENT_BINARY_DIR} # for tracepoints.h |
924 | ) |
925 | |
926 | include_directories( |
927 | @@ -95,7 +97,7 @@ |
928 | Qt5::Qml |
929 | Qt5::Quick |
930 | |
931 | - qpa-mirserver |
932 | + qtmirserver |
933 | ) |
934 | |
935 | # Generate tracepoints.c and .h from tracepoints.tp |
936 | |
937 | === modified file 'src/modules/Unity/Application/taskcontroller.cpp' |
938 | --- src/modules/Unity/Application/taskcontroller.cpp 2017-03-22 11:00:48 +0000 |
939 | +++ src/modules/Unity/Application/taskcontroller.cpp 2017-04-05 10:39:22 +0000 |
940 | @@ -25,7 +25,7 @@ |
941 | #include "nativeinterface.h" |
942 | #include "promptsessionlistener.h" |
943 | #include "promptsession.h" |
944 | -#include "sessionauthorizer.h" |
945 | +#include "qtmir/sessionauthorizer.h" |
946 | |
947 | // common |
948 | #include "appnotifier.h" |
949 | |
950 | === modified file 'src/modules/Unity/Screens/CMakeLists.txt' |
951 | --- src/modules/Unity/Screens/CMakeLists.txt 2016-11-03 20:17:46 +0000 |
952 | +++ src/modules/Unity/Screens/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
953 | @@ -22,7 +22,7 @@ |
954 | target_link_libraries( |
955 | unityscreensplugin |
956 | |
957 | - qpa-mirserver |
958 | + qtmirserver |
959 | |
960 | Qt5::Gui |
961 | Qt5::Qml |
962 | |
963 | === modified file 'src/platforms/mirserver/CMakeLists.txt' |
964 | --- src/platforms/mirserver/CMakeLists.txt 2017-03-20 21:15:29 +0000 |
965 | +++ src/platforms/mirserver/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
966 | @@ -1,6 +1,9 @@ |
967 | # Qt5PlatformSupport is not available as a cmake module. |
968 | # And also not anymore as pkgconfig module since Qt 5.6. |
969 | #pkg_check_modules(QT5PLATFORM_SUPPORT Qt5PlatformSupport REQUIRED) |
970 | +include(FindQt5PlatformSupport) |
971 | + |
972 | +set(QTMIRSERVER_ABI 1) |
973 | |
974 | add_subdirectory(miral) |
975 | |
976 | @@ -13,34 +16,29 @@ |
977 | add_definitions(-DQGL_DEBUG) |
978 | endif() |
979 | |
980 | -#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -fPIC") |
981 | - |
982 | -# Dirty hack: The private QtPlatformSupport include dirs are not made available via |
983 | -# a cmake module or the pkgconfig file (which only exposes the necessary linker flags) |
984 | -# So we generate the paths ourselves from the Qt5Gui private dirs! |
985 | -set(QT5_PLATFORMSUPPORT_INCLUDE_DIRS) |
986 | -foreach(item ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) |
987 | - set(newitem "") |
988 | - string(REGEX REPLACE "QtGui" "QtPlatformSupport" newitem ${item}) |
989 | - list(APPEND QT5_PLATFORMSUPPORT_INCLUDE_DIRS ${newitem}) |
990 | -endforeach(item ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) |
991 | - |
992 | include_directories( |
993 | + ${CMAKE_SOURCE_DIR}/include |
994 | ${CMAKE_SOURCE_DIR}/src/common |
995 | + ${CMAKE_CURRENT_BINARY_DIR} # for tracepoints.h |
996 | ) |
997 | |
998 | include_directories( |
999 | SYSTEM |
1000 | ${MIRAL_INCLUDE_DIRS} |
1001 | + ${MIRCOMMON_INCLUDE_DIRS} |
1002 | + ${MIRSERVER_INCLUDE_DIRS} |
1003 | ${MIRRENDERERGLDEV_INCLUDE_DIRS} |
1004 | |
1005 | ${URL_DISPATCHER_INCLUDE_DIRS} |
1006 | ${EGL_INCLUDE_DIRS} |
1007 | ${LTTNG_INCLUDE_DIRS} |
1008 | |
1009 | - ${QT5PLATFORM_SUPPORT_INCLUDE_DIRS} |
1010 | + ${Qt5PlatformSupport_INCLUDE_DIRS} |
1011 | + |
1012 | + ${Qt5Gui_INCLUDE_DIRS} |
1013 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
1014 | - ${QT5_PLATFORMSUPPORT_INCLUDE_DIRS} |
1015 | + |
1016 | + ${Qt5Quick_INCLUDE_DIRS} |
1017 | ${Qt5Quick_PRIVATE_INCLUDE_DIRS} |
1018 | |
1019 | ${APPLICATION_API_INCLUDE_DIRS} |
1020 | @@ -56,16 +54,15 @@ |
1021 | add_definitions(-DBYTE_ORDER=__BYTE_ORDER) |
1022 | |
1023 | # These files will compile without mirserver-dev |
1024 | -add_library(qpa-mirserver-nomirserver OBJECT |
1025 | +add_library(qtmirserver-nomirserver OBJECT |
1026 | ${CMAKE_SOURCE_DIR}/src/common/timestamp.cpp |
1027 | logging.cpp |
1028 | - plugin.cpp |
1029 | shelluuid.cpp |
1030 | - ubuntutheme.cpp |
1031 | clipboard.cpp |
1032 | mirsingleton.cpp |
1033 | - sessionauthorizer.cpp |
1034 | + wrappedsessionauthorizer.cpp |
1035 | promptsessionlistener.cpp |
1036 | + displayconfigurationstorage.cpp |
1037 | nativeinterface.cpp |
1038 | services.cpp |
1039 | windowcontroller.cpp |
1040 | @@ -79,13 +76,13 @@ |
1041 | include_directories(SYSTEM ${MIRSERVER_INCLUDE_DIRS}) |
1042 | |
1043 | # These files will only compile with mirserver-dev |
1044 | -add_library(qpa-mirserver-mirserver OBJECT |
1045 | +add_library(qtmirserver-mirserver OBJECT |
1046 | openglcontextfactory.cpp openglcontextfactory.h |
1047 | mircursorimages.cpp |
1048 | - mirdisplayconfigurationpolicy.cpp |
1049 | screenscontroller.cpp |
1050 | qtcompositor.cpp |
1051 | - windowmanagementpolicy.cpp |
1052 | + displayconfigurationpolicy.cpp |
1053 | + wrappedwindowmanagementpolicy.cpp |
1054 | mirserverhooks.cpp mirserverhooks.h |
1055 | setqtcompositor.cpp setqtcompositor.h |
1056 | eventdispatch.cpp eventdispatch.h |
1057 | @@ -93,7 +90,7 @@ |
1058 | ) |
1059 | |
1060 | # These files get entangled by automoc so they need to go together. And some depend on mirserver-dev |
1061 | -set(MIRSERVER_QPA_PLUGIN_SRC |
1062 | +set(QMIRSERVER_PLUGIN_SRC |
1063 | ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp |
1064 | cursor.cpp |
1065 | eventbuilder.cpp |
1066 | @@ -103,41 +100,106 @@ |
1067 | screen.cpp |
1068 | screenwindow.cpp |
1069 | screensmodel.cpp |
1070 | - mirserverintegration.cpp |
1071 | miropenglcontext.cpp |
1072 | offscreensurface.cpp |
1073 | - # We need to run moc on these headers |
1074 | + inputdeviceobserver.cpp |
1075 | + mirserverapplication.cpp |
1076 | + |
1077 | +# We need to run moc on these headers |
1078 | + ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirMousePointerInterface.h |
1079 | ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/Mir.h |
1080 | - ${CMAKE_SOURCE_DIR}/src/common/appnotifier.h |
1081 | + |
1082 | + ${CMAKE_SOURCE_DIR}/include/qtmir/mirserverapplication.h |
1083 | + ${CMAKE_SOURCE_DIR}/include/qtmir/displayconfigurationpolicy.h |
1084 | + ${CMAKE_SOURCE_DIR}/include/qtmir/sessionauthorizer.h |
1085 | + ${CMAKE_SOURCE_DIR}/include/qtmir/windowmanagementpolicy.h |
1086 | + ${CMAKE_SOURCE_DIR}/include/qtmir/displayconfigurationstorage.h |
1087 | + |
1088 | ${CMAKE_SOURCE_DIR}/src/common/windowcontrollerinterface.h |
1089 | ${CMAKE_SOURCE_DIR}/src/common/windowmodelnotifier.h |
1090 | - inputdeviceobserver.cpp |
1091 | + ${CMAKE_SOURCE_DIR}/src/common/appnotifier.h |
1092 | +) |
1093 | + |
1094 | +add_library(qtmirserver SHARED |
1095 | + ${QMIRSERVER_PLUGIN_SRC} |
1096 | + $<TARGET_OBJECTS:qtmirserver-nomirserver> |
1097 | + $<TARGET_OBJECTS:qtmirserver-mirserver> |
1098 | $<TARGET_OBJECTS:miral-prototypes> |
1099 | -# We need to run moc on these headers |
1100 | - ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirMousePointerInterface.h |
1101 | -) |
1102 | +) |
1103 | + |
1104 | +target_link_libraries(qtmirserver |
1105 | + PUBLIC |
1106 | + ${MIRAL_LDFLAGS} |
1107 | + ${MIRSERVER_LDFLAGS} |
1108 | + Qt5::Core |
1109 | + Qt5::Gui |
1110 | + |
1111 | + PRIVATE |
1112 | + ${URL_DISPATCHER_LDFLAGS} |
1113 | + ${EGL_LDFLAGS} |
1114 | + ${GL_LIBRARIES} |
1115 | + ${LTTNG_LIBRARIES} |
1116 | + ${GIO_LDFLAGS} |
1117 | + ${FONTCONFIG_LDFLAGS} |
1118 | + ${XKBCOMMON_LIBRARIES} |
1119 | + |
1120 | + ${CONTENT_HUB_LIBRARIES} |
1121 | + |
1122 | + Qt5::DBus |
1123 | + Qt5::Quick |
1124 | + Qt5::Sensors |
1125 | + ${Qt5PlatformSupport_LIBRARIES} |
1126 | +) |
1127 | + |
1128 | +set_target_properties(qtmirserver |
1129 | + PROPERTIES |
1130 | + SOVERSION ${QTMIRSERVER_ABI} |
1131 | +) |
1132 | + |
1133 | +set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") |
1134 | +set(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/qtmir") |
1135 | + |
1136 | +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qtmirserver.pc.in |
1137 | + ${CMAKE_CURRENT_BINARY_DIR}/qtmirserver.pc |
1138 | + @ONLY |
1139 | +) |
1140 | + |
1141 | +include(UseLttngGenTp) |
1142 | +add_lttng_gen_tp(NAME tracepoints) |
1143 | + |
1144 | +install( |
1145 | + TARGETS qtmirserver |
1146 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
1147 | + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
1148 | +) |
1149 | + |
1150 | +install( |
1151 | + DIRECTORY ${CMAKE_SOURCE_DIR}/include/qtmir |
1152 | + DESTINATION "include/qtmir" |
1153 | +) |
1154 | + |
1155 | +install( |
1156 | + FILES ${CMAKE_CURRENT_BINARY_DIR}/qtmirserver.pc |
1157 | + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig |
1158 | +) |
1159 | + |
1160 | |
1161 | add_library(qpa-mirserver SHARED |
1162 | - ${MIRSERVER_QPA_PLUGIN_SRC} |
1163 | - $<TARGET_OBJECTS:qpa-mirserver-nomirserver> |
1164 | - $<TARGET_OBJECTS:qpa-mirserver-mirserver> |
1165 | + mirserverintegration.cpp |
1166 | + plugin.cpp |
1167 | + ubuntutheme.cpp |
1168 | ) |
1169 | |
1170 | -target_link_libraries( |
1171 | - qpa-mirserver |
1172 | - Qt5PlatformSupport |
1173 | +target_link_libraries(qpa-mirserver |
1174 | +PRIVATE |
1175 | + qtmirserver |
1176 | + ${Qt5PlatformSupport_LIBRARIES} |
1177 | |
1178 | - ${MIRAL_LDFLAGS} |
1179 | ${MIRSERVER_LDFLAGS} |
1180 | ${URL_DISPATCHER_LDFLAGS} |
1181 | ${EGL_LDFLAGS} |
1182 | ${GL_LIBRARIES} |
1183 | ${LTTNG_LIBRARIES} |
1184 | - |
1185 | - ${QT5PLATFORM_SUPPORT_LDFLAGS} |
1186 | - # TODO Qt5Platform support LDFLAGS dont provide actual required ldflags... |
1187 | - # I found these were needed...perhaps there is some way to query qmake/qconfig? |
1188 | - -lfreetype |
1189 | ${GIO_LDFLAGS} |
1190 | ${FONTCONFIG_LDFLAGS} |
1191 | ${XKBCOMMON_LIBRARIES} |
1192 | @@ -150,7 +212,4 @@ |
1193 | Qt5::Sensors |
1194 | ) |
1195 | |
1196 | -include(UseLttngGenTp) |
1197 | -add_lttng_gen_tp(NAME tracepoints) |
1198 | - |
1199 | install(TARGETS qpa-mirserver LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/qt5/plugins/platforms") |
1200 | |
1201 | === renamed file 'src/platforms/mirserver/mirdisplayconfigurationpolicy.cpp' => 'src/platforms/mirserver/displayconfigurationpolicy.cpp' |
1202 | --- src/platforms/mirserver/mirdisplayconfigurationpolicy.cpp 2017-01-05 14:36:10 +0000 |
1203 | +++ src/platforms/mirserver/displayconfigurationpolicy.cpp 2017-04-05 10:39:22 +0000 |
1204 | @@ -14,35 +14,28 @@ |
1205 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1206 | */ |
1207 | |
1208 | -#include "mirdisplayconfigurationpolicy.h" |
1209 | +// qtmir |
1210 | +#include "qtmir/displayconfigurationpolicy.h" |
1211 | +#include "qmirserver.h" |
1212 | |
1213 | -#include <mir/graphics/display_configuration_policy.h> |
1214 | +// mir |
1215 | +#include <mir/geometry/point.h> |
1216 | #include <mir/graphics/display_configuration.h> |
1217 | -#include <mir/geometry/point.h> |
1218 | -#include <mir/server.h> |
1219 | |
1220 | #include <qglobal.h> |
1221 | #include <QByteArray> |
1222 | |
1223 | -namespace mg = mir::graphics; |
1224 | - |
1225 | #define ENV_GRID_UNIT_PX "GRID_UNIT_PX" |
1226 | #define DEFAULT_GRID_UNIT_PX 8 |
1227 | |
1228 | -namespace { |
1229 | -class MirDisplayConfigurationPolicy : public mir::graphics::DisplayConfigurationPolicy |
1230 | -{ |
1231 | -public: |
1232 | - MirDisplayConfigurationPolicy(const std::shared_ptr<mir::graphics::DisplayConfigurationPolicy> &wrapped); |
1233 | - |
1234 | - void apply_to(mir::graphics::DisplayConfiguration &conf) override; |
1235 | - |
1236 | -private: |
1237 | - const std::shared_ptr<mir::graphics::DisplayConfigurationPolicy> m_wrapped; |
1238 | - float m_defaultScale; |
1239 | -}; |
1240 | - |
1241 | -static float getenvFloat(const char* name, float defaultValue) |
1242 | +namespace mg = mir::graphics; |
1243 | + |
1244 | +namespace qtmir |
1245 | +{ |
1246 | +namespace |
1247 | +{ |
1248 | + |
1249 | +float getenvFloat(const char* name, float defaultValue) |
1250 | { |
1251 | QByteArray stringValue = qgetenv(name); |
1252 | bool ok; |
1253 | @@ -50,23 +43,31 @@ |
1254 | return ok ? value : defaultValue; |
1255 | } |
1256 | |
1257 | -MirDisplayConfigurationPolicy::MirDisplayConfigurationPolicy( |
1258 | - const std::shared_ptr<mir::graphics::DisplayConfigurationPolicy> &wrapped) |
1259 | - : m_wrapped(wrapped) |
1260 | +} // namespace |
1261 | + |
1262 | +struct DisplayConfigurationPolicy::Private |
1263 | { |
1264 | - float gridUnit = DEFAULT_GRID_UNIT_PX; |
1265 | - if (qEnvironmentVariableIsSet(ENV_GRID_UNIT_PX)) { |
1266 | - gridUnit = getenvFloat(ENV_GRID_UNIT_PX, DEFAULT_GRID_UNIT_PX); |
1267 | + Private() |
1268 | + { |
1269 | + float gridUnit = DEFAULT_GRID_UNIT_PX; |
1270 | + if (qEnvironmentVariableIsSet(ENV_GRID_UNIT_PX)) { |
1271 | + gridUnit = getenvFloat(ENV_GRID_UNIT_PX, DEFAULT_GRID_UNIT_PX); |
1272 | + } |
1273 | + m_defaultScale = gridUnit / DEFAULT_GRID_UNIT_PX; |
1274 | } |
1275 | - m_defaultScale = gridUnit / DEFAULT_GRID_UNIT_PX; |
1276 | + |
1277 | + float m_defaultScale; |
1278 | +}; |
1279 | + |
1280 | +DisplayConfigurationPolicy::DisplayConfigurationPolicy() : |
1281 | + d(new DisplayConfigurationPolicy::Private) |
1282 | +{ |
1283 | } |
1284 | |
1285 | -void MirDisplayConfigurationPolicy::apply_to(mg::DisplayConfiguration &conf) |
1286 | +void DisplayConfigurationPolicy::apply_to(mg::DisplayConfiguration& conf) |
1287 | { |
1288 | int nextTopLeftPosition = 0; |
1289 | |
1290 | - m_wrapped->apply_to(conf); |
1291 | - |
1292 | //TODO: scan through saved configurations and select matching one to apply |
1293 | |
1294 | // We want to apply a particular display config policy when connecting an external display |
1295 | @@ -101,22 +102,35 @@ |
1296 | if (phoneDetected) { |
1297 | if (screenCount == 1 || output.type == mg::DisplayConfigurationOutputType::lvds) { |
1298 | output.form_factor = mir_form_factor_phone; |
1299 | - output.scale = m_defaultScale; |
1300 | + output.scale = d->m_defaultScale; |
1301 | } else { // screenCount > 1 && output.type != lvds |
1302 | output.form_factor = mir_form_factor_monitor; |
1303 | output.scale = 1; |
1304 | } |
1305 | } else { // desktop |
1306 | output.form_factor = mir_form_factor_monitor; |
1307 | - output.scale = m_defaultScale; // probably 1 on desktop anyway. |
1308 | + output.scale = d->m_defaultScale; // probably 1 on desktop anyway. |
1309 | } |
1310 | }); |
1311 | } |
1312 | |
1313 | -} //namespace |
1314 | - |
1315 | -auto qtmir::wrapDisplayConfigurationPolicy(const std::shared_ptr<mg::DisplayConfigurationPolicy>& wrapped) |
1316 | --> std::shared_ptr<mg::DisplayConfigurationPolicy> |
1317 | -{ |
1318 | - return std::make_shared<MirDisplayConfigurationPolicy>(wrapped); |
1319 | -} |
1320 | + |
1321 | +struct BasicSetDisplayConfigurationPolicy::Self |
1322 | +{ |
1323 | + Self(DisplayConfigurationPolicyWrapper const& builder) : |
1324 | + builder{builder} {} |
1325 | + |
1326 | + DisplayConfigurationPolicyWrapper builder; |
1327 | +}; |
1328 | + |
1329 | +BasicSetDisplayConfigurationPolicy::BasicSetDisplayConfigurationPolicy(DisplayConfigurationPolicyWrapper const& builder) |
1330 | + : self(std::make_shared<Self>(builder)) |
1331 | +{ |
1332 | +} |
1333 | + |
1334 | +void BasicSetDisplayConfigurationPolicy::operator()(QMirServer& server) |
1335 | +{ |
1336 | + server.wrapDisplayConfigurationPolicy(self->builder); |
1337 | +} |
1338 | + |
1339 | +} // namespace qtmir |
1340 | |
1341 | === added file 'src/platforms/mirserver/displayconfigurationstorage.cpp' |
1342 | --- src/platforms/mirserver/displayconfigurationstorage.cpp 1970-01-01 00:00:00 +0000 |
1343 | +++ src/platforms/mirserver/displayconfigurationstorage.cpp 2017-04-05 10:39:22 +0000 |
1344 | @@ -0,0 +1,46 @@ |
1345 | +/* |
1346 | + * Copyright (C) 2017 Canonical, Ltd. |
1347 | + * |
1348 | + * This program is free software: you can redistribute it and/or modify it under |
1349 | + * the terms of the GNU Lesser General Public License version 3, as published by |
1350 | + * the Free Software Foundation. |
1351 | + * |
1352 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
1353 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
1354 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1355 | + * Lesser General Public License for more details. |
1356 | + * |
1357 | + * You should have received a copy of the GNU Lesser General Public License |
1358 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1359 | + */ |
1360 | + |
1361 | +#include "qtmir/displayconfigurationpolicy.h" |
1362 | +#include "qmirserver.h" |
1363 | + |
1364 | +namespace qtmir |
1365 | +{ |
1366 | + |
1367 | +struct BasicSetDisplayConfigurationStorage::Self |
1368 | +{ |
1369 | + Self(DisplayConfigurationStorageBuilder const& builder) : |
1370 | + builder{builder} {} |
1371 | + |
1372 | + DisplayConfigurationStorageBuilder builder; |
1373 | +}; |
1374 | + |
1375 | +BasicSetDisplayConfigurationStorage::BasicSetDisplayConfigurationStorage(const DisplayConfigurationStorageBuilder &builder) : |
1376 | + self(std::make_shared<Self>(builder)) |
1377 | +{ |
1378 | +} |
1379 | + |
1380 | +void BasicSetDisplayConfigurationStorage::operator()(QMirServer &server) |
1381 | +{ |
1382 | + server.overrideDisplayConfigurationStorage(*this); |
1383 | +} |
1384 | + |
1385 | +DisplayConfigurationStorageBuilder BasicSetDisplayConfigurationStorage::builder() const |
1386 | +{ |
1387 | + return self->builder; |
1388 | +} |
1389 | + |
1390 | +} // namespace qtmir |
1391 | |
1392 | === modified file 'src/platforms/mirserver/miral/CMakeLists.txt' |
1393 | --- src/platforms/mirserver/miral/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
1394 | +++ src/platforms/mirserver/miral/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
1395 | @@ -1,8 +1,13 @@ |
1396 | include_directories(SYSTEM ${MIRSERVER_INCLUDE_DIRS} ${MIRRENDERERGLDEV_INCLUDE_DIRS}) |
1397 | |
1398 | +include_directories( |
1399 | + ${CMAKE_SOURCE_DIR}/include |
1400 | +) |
1401 | + |
1402 | add_library(miral-prototypes OBJECT |
1403 | - edid.cpp edid.h |
1404 | - display_configuration_storage.h |
1405 | persist_display_config.cpp persist_display_config.h |
1406 | mirbuffer.cpp mirbuffer.h |
1407 | + ${CMAKE_SOURCE_DIR}/include/qtmir/miral/display_configuration_storage.h |
1408 | + edid.cpp ${CMAKE_SOURCE_DIR}/include/qtmir/miral/edid.h |
1409 | + display_configuration_policy.cpp ${CMAKE_SOURCE_DIR}/include/qtmir/miral/display_configuration_policy.h |
1410 | ) |
1411 | |
1412 | === added file 'src/platforms/mirserver/miral/display_configuration_policy.cpp' |
1413 | --- src/platforms/mirserver/miral/display_configuration_policy.cpp 1970-01-01 00:00:00 +0000 |
1414 | +++ src/platforms/mirserver/miral/display_configuration_policy.cpp 2017-04-05 10:39:22 +0000 |
1415 | @@ -0,0 +1,21 @@ |
1416 | +/* |
1417 | + * Copyright © 2016 Canonical Ltd. |
1418 | + * |
1419 | + * This program is free software: you can redistribute it and/or modify it |
1420 | + * under the terms of the GNU General Public License version 3, |
1421 | + * as published by the Free Software Foundation. |
1422 | + * |
1423 | + * This program is distributed in the hope that it will be useful, |
1424 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1425 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1426 | + * GNU General Public License for more details. |
1427 | + * |
1428 | + * You should have received a copy of the GNU General Public License |
1429 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1430 | + * |
1431 | + * Authored by: Nick Dedekind <nick.dedekind@canonical.com> |
1432 | + */ |
1433 | + |
1434 | +#include "qtmir/miral/display_configuration_policy.h" |
1435 | + |
1436 | +miral::DisplayConfigurationPolicy::DisplayConfigurationPolicy() = default; |
1437 | |
1438 | === modified file 'src/platforms/mirserver/miral/edid.cpp' |
1439 | --- src/platforms/mirserver/miral/edid.cpp 2017-04-05 10:39:22 +0000 |
1440 | +++ src/platforms/mirserver/miral/edid.cpp 2017-04-05 10:39:22 +0000 |
1441 | @@ -16,7 +16,7 @@ |
1442 | * Authored by: Nick Dedekind <nick.dedekind@canonical.com> |
1443 | */ |
1444 | |
1445 | -#include "edid.h" |
1446 | +#include "qtmir/miral/edid.h" |
1447 | |
1448 | #include <cstring> |
1449 | #include <numeric> |
1450 | |
1451 | === modified file 'src/platforms/mirserver/miral/persist_display_config.cpp' |
1452 | --- src/platforms/mirserver/miral/persist_display_config.cpp 2017-04-05 10:39:22 +0000 |
1453 | +++ src/platforms/mirserver/miral/persist_display_config.cpp 2017-04-05 10:39:22 +0000 |
1454 | @@ -17,8 +17,9 @@ |
1455 | */ |
1456 | |
1457 | #include "persist_display_config.h" |
1458 | -#include "display_configuration_storage.h" |
1459 | -#include "edid.h" |
1460 | +#include "qtmir/miral/display_configuration_policy.h" |
1461 | +#include "qtmir/miral/display_configuration_storage.h" |
1462 | +#include "qtmir/miral/edid.h" |
1463 | |
1464 | #include <mir/graphics/display_configuration_policy.h> |
1465 | #include <mir/graphics/display_configuration.h> |
1466 | @@ -26,10 +27,14 @@ |
1467 | #include <mir/observer_registrar.h> |
1468 | #include <mir/server.h> |
1469 | |
1470 | +// shouldn't really import this |
1471 | +#include <qglobal.h> |
1472 | + |
1473 | namespace mg = mir::graphics; |
1474 | |
1475 | namespace |
1476 | { |
1477 | + |
1478 | struct PersistDisplayConfigPolicy |
1479 | { |
1480 | PersistDisplayConfigPolicy(std::shared_ptr<miral::DisplayConfigurationStorage> const& storage) : |
1481 | @@ -38,27 +43,45 @@ |
1482 | PersistDisplayConfigPolicy(PersistDisplayConfigPolicy const&) = delete; |
1483 | auto operator=(PersistDisplayConfigPolicy const&) -> PersistDisplayConfigPolicy& = delete; |
1484 | |
1485 | - void apply_to(mg::DisplayConfiguration& conf, mg::DisplayConfigurationPolicy& default_policy); |
1486 | + void apply_to(mg::DisplayConfiguration& conf, |
1487 | + miral::DisplayConfigurationPolicy& wrapped_policy, |
1488 | + miral::DisplayConfigurationPolicy& custom_policy); |
1489 | void save_config(mg::DisplayConfiguration const& base_conf); |
1490 | |
1491 | std::shared_ptr<miral::DisplayConfigurationStorage> storage; |
1492 | }; |
1493 | |
1494 | +struct MiralWrappedMirDisplayConfigurationPolicy : miral::DisplayConfigurationPolicy |
1495 | +{ |
1496 | + MiralWrappedMirDisplayConfigurationPolicy(std::shared_ptr<mg::DisplayConfigurationPolicy> const& self) : |
1497 | + self{self} |
1498 | + {} |
1499 | + |
1500 | + void apply_to(mg::DisplayConfiguration& conf) override |
1501 | + { |
1502 | + self->apply_to(conf); |
1503 | + } |
1504 | + |
1505 | + std::shared_ptr<mg::DisplayConfigurationPolicy> self; |
1506 | +}; |
1507 | + |
1508 | struct DisplayConfigurationPolicyAdapter : mg::DisplayConfigurationPolicy |
1509 | { |
1510 | DisplayConfigurationPolicyAdapter( |
1511 | std::shared_ptr<PersistDisplayConfigPolicy> const& self, |
1512 | - std::shared_ptr<mg::DisplayConfigurationPolicy> const& wrapped) : |
1513 | - self{self}, default_policy{wrapped} |
1514 | + std::shared_ptr<miral::DisplayConfigurationPolicy> const& wrapped_policy, |
1515 | + std::shared_ptr<miral::DisplayConfigurationPolicy> const& custom_policy) : |
1516 | + self{self}, wrapped_policy{wrapped_policy}, custom_policy{custom_policy} |
1517 | {} |
1518 | |
1519 | void apply_to(mg::DisplayConfiguration& conf) override |
1520 | { |
1521 | - self->apply_to(conf, *default_policy); |
1522 | + self->apply_to(conf, *wrapped_policy, *custom_policy); |
1523 | } |
1524 | |
1525 | std::shared_ptr<PersistDisplayConfigPolicy> const self; |
1526 | - std::shared_ptr<mg::DisplayConfigurationPolicy> const default_policy; |
1527 | + std::shared_ptr<miral::DisplayConfigurationPolicy> const wrapped_policy; |
1528 | + std::shared_ptr<miral::DisplayConfigurationPolicy> const custom_policy; |
1529 | }; |
1530 | |
1531 | struct DisplayConfigurationObserver : mg::DisplayConfigurationObserver |
1532 | @@ -75,19 +98,27 @@ |
1533 | std::shared_ptr<mg::DisplayConfiguration const> const& /*failed_fallback*/, |
1534 | std::exception const& /*error*/) override {} |
1535 | }; |
1536 | + |
1537 | +miral::DisplayConfigurationOptions::DisplayMode current_mode_of(mg::DisplayConfigurationOutput const& output) |
1538 | +{ |
1539 | + miral::DisplayConfigurationOptions::DisplayMode mode; |
1540 | + if (output.current_mode_index >= output.modes.size()) return mode; |
1541 | + |
1542 | + auto const& current_mode = output.modes[output.current_mode_index]; |
1543 | + mode.size = current_mode.size; |
1544 | + mode.refresh_rate = current_mode.vrefresh_hz; |
1545 | + return mode; |
1546 | +} |
1547 | } |
1548 | |
1549 | struct miral::PersistDisplayConfig::Self : PersistDisplayConfigPolicy, DisplayConfigurationObserver |
1550 | { |
1551 | - Self(std::shared_ptr<DisplayConfigurationStorage> const& storage) : |
1552 | - PersistDisplayConfigPolicy(storage) {} |
1553 | Self(std::shared_ptr<DisplayConfigurationStorage> const& storage, |
1554 | DisplayConfigurationPolicyWrapper const& custom_wrapper) : |
1555 | PersistDisplayConfigPolicy(storage), |
1556 | custom_wrapper{custom_wrapper} {} |
1557 | |
1558 | - DisplayConfigurationPolicyWrapper const custom_wrapper = |
1559 | - [](const std::shared_ptr<mg::DisplayConfigurationPolicy> &wrapped) { return wrapped; }; |
1560 | + DisplayConfigurationPolicyWrapper const custom_wrapper; |
1561 | |
1562 | void base_configuration_updated(std::shared_ptr<mg::DisplayConfiguration const> const& base_config) override |
1563 | { |
1564 | @@ -99,11 +130,6 @@ |
1565 | void session_configuration_removed(std::shared_ptr<mir::frontend::Session> const&) {} |
1566 | }; |
1567 | |
1568 | -miral::PersistDisplayConfig::PersistDisplayConfig(std::shared_ptr<DisplayConfigurationStorage> const& storage) : |
1569 | - self{std::make_shared<Self>(storage)} |
1570 | -{ |
1571 | -} |
1572 | - |
1573 | miral::PersistDisplayConfig::PersistDisplayConfig(std::shared_ptr<DisplayConfigurationStorage> const& storage, |
1574 | DisplayConfigurationPolicyWrapper const& custom_wrapper) : |
1575 | self{std::make_shared<Self>(storage, custom_wrapper)} |
1576 | @@ -122,7 +148,10 @@ |
1577 | [this](std::shared_ptr<mg::DisplayConfigurationPolicy> const& wrapped) |
1578 | -> std::shared_ptr<mg::DisplayConfigurationPolicy> |
1579 | { |
1580 | - return std::make_shared<DisplayConfigurationPolicyAdapter>(self, self->custom_wrapper(wrapped)); |
1581 | + auto custom_wrapper = self->custom_wrapper(); |
1582 | + return std::make_shared<DisplayConfigurationPolicyAdapter>(self, |
1583 | + std::make_shared<MiralWrappedMirDisplayConfigurationPolicy>(wrapped), |
1584 | + custom_wrapper); |
1585 | }); |
1586 | |
1587 | server.add_init_callback([this, &server] |
1588 | @@ -131,9 +160,13 @@ |
1589 | |
1590 | void PersistDisplayConfigPolicy::apply_to( |
1591 | mg::DisplayConfiguration& conf, |
1592 | - mg::DisplayConfigurationPolicy& default_policy) |
1593 | + miral::DisplayConfigurationPolicy& wrapped_policy, |
1594 | + miral::DisplayConfigurationPolicy& custom_policy) |
1595 | { |
1596 | - default_policy.apply_to(conf); |
1597 | + // first apply the policy we wrapped by setting a custom policy |
1598 | + wrapped_policy.apply_to(conf); |
1599 | + // then apply the custom policy |
1600 | + custom_policy.apply_to(conf); |
1601 | |
1602 | if (!storage) { |
1603 | throw std::runtime_error("No display configuration storage supplied."); |
1604 | @@ -154,12 +187,14 @@ |
1605 | miral::DisplayConfigurationOptions config; |
1606 | if (storage->load(display_id, config)) { |
1607 | |
1608 | - if (config.size.is_set()) { |
1609 | + if (config.mode.is_set()) { |
1610 | int mode_index = output.current_mode_index; |
1611 | int i = 0; |
1612 | // Find the mode index which supports the saved size. |
1613 | for (auto iter = output.modes.cbegin(); iter != output.modes.cend(); ++iter, i++) { |
1614 | - if ((*iter).size == config.size.value()) { |
1615 | + auto const& mode = *iter; |
1616 | + auto const& newMode = config.mode.value(); |
1617 | + if (mode.size == newMode.size && qFuzzyCompare(mode.vrefresh_hz, newMode.refresh_rate)) { |
1618 | mode_index = i; |
1619 | break; |
1620 | } |
1621 | @@ -209,7 +244,7 @@ |
1622 | output_index++; |
1623 | }); |
1624 | |
1625 | - config.size = output.extents().size; |
1626 | + config.mode = current_mode_of(output); |
1627 | config.form_factor = output.form_factor; |
1628 | config.orientation = output.orientation; |
1629 | config.scale = output.scale; |
1630 | |
1631 | === modified file 'src/platforms/mirserver/miral/persist_display_config.h' |
1632 | --- src/platforms/mirserver/miral/persist_display_config.h 2017-04-05 10:39:22 +0000 |
1633 | +++ src/platforms/mirserver/miral/persist_display_config.h 2017-04-05 10:39:22 +0000 |
1634 | @@ -22,25 +22,24 @@ |
1635 | #include <functional> |
1636 | #include <memory> |
1637 | |
1638 | -namespace mir { class Server; namespace graphics { class DisplayConfigurationPolicy; }} |
1639 | +namespace mir { class Server; } |
1640 | |
1641 | // Prototyping namespace for later incorporation in MirAL |
1642 | namespace miral |
1643 | { |
1644 | +class DisplayConfigurationPolicy; |
1645 | class DisplayConfigurationStorage; |
1646 | |
1647 | /// Restores the saved display configuration and saves changes to the base configuration |
1648 | class PersistDisplayConfig |
1649 | { |
1650 | public: |
1651 | - PersistDisplayConfig(std::shared_ptr<DisplayConfigurationStorage> const& storage); |
1652 | ~PersistDisplayConfig(); |
1653 | PersistDisplayConfig(PersistDisplayConfig const&); |
1654 | auto operator=(PersistDisplayConfig const&) -> PersistDisplayConfig&; |
1655 | |
1656 | // TODO factor this out better |
1657 | - using DisplayConfigurationPolicyWrapper = |
1658 | - std::function<std::shared_ptr<mir::graphics::DisplayConfigurationPolicy>(const std::shared_ptr<mir::graphics::DisplayConfigurationPolicy> &wrapped)>; |
1659 | + using DisplayConfigurationPolicyWrapper = std::function<std::shared_ptr<DisplayConfigurationPolicy>()>; |
1660 | |
1661 | PersistDisplayConfig(std::shared_ptr<DisplayConfigurationStorage> const& storage, |
1662 | DisplayConfigurationPolicyWrapper const& custom_wrapper); |
1663 | |
1664 | === added file 'src/platforms/mirserver/mirserverapplication.cpp' |
1665 | --- src/platforms/mirserver/mirserverapplication.cpp 1970-01-01 00:00:00 +0000 |
1666 | +++ src/platforms/mirserver/mirserverapplication.cpp 2017-04-05 10:39:22 +0000 |
1667 | @@ -0,0 +1,53 @@ |
1668 | +/* |
1669 | + * Copyright (C) 2016 Canonical, Ltd. |
1670 | + * |
1671 | + * This program is free software: you can redistribute it and/or modify it under |
1672 | + * the terms of the GNU Lesser General Public License version 3, as published by |
1673 | + * the Free Software Foundation. |
1674 | + * |
1675 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
1676 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
1677 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1678 | + * Lesser General Public License for more details. |
1679 | + * |
1680 | + * You should have received a copy of the GNU Lesser General Public License |
1681 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1682 | + */ |
1683 | + |
1684 | +#include "qtmir/mirserverapplication.h" |
1685 | +#include "qmirserver.h" |
1686 | + |
1687 | +#include <QDebug> |
1688 | + |
1689 | +namespace qtmir { |
1690 | + |
1691 | +namespace { |
1692 | + |
1693 | +QSharedPointer<QMirServer> mirServer; |
1694 | + |
1695 | +void init(std::initializer_list<std::function<void(QMirServer&)>> const& options) |
1696 | +{ |
1697 | + setenv("QT_QPA_PLATFORM", "mirserver", 1 /* overwrite */); |
1698 | + |
1699 | + mirServer = QMirServer::create(); |
1700 | + for (auto& option : options) { |
1701 | + option(*mirServer.data()); |
1702 | + } |
1703 | +} |
1704 | + |
1705 | +} // namespace |
1706 | + |
1707 | +MirServerApplication::MirServerApplication(int &argc, |
1708 | + char **argv, |
1709 | + std::initializer_list<std::function<void(QMirServer&)>> options) |
1710 | + : QGuiApplication((init(options), argc), argv) // comma operator to ensure init called before QGuiApplication |
1711 | +{ |
1712 | + Q_UNUSED(options); |
1713 | +} |
1714 | + |
1715 | +MirServerApplication::~MirServerApplication() |
1716 | +{ |
1717 | + mirServer.clear(); |
1718 | +} |
1719 | + |
1720 | +} // qtmir |
1721 | |
1722 | === modified file 'src/platforms/mirserver/mirserverintegration.cpp' |
1723 | --- src/platforms/mirserver/mirserverintegration.cpp 2017-02-21 18:53:48 +0000 |
1724 | +++ src/platforms/mirserver/mirserverintegration.cpp 2017-04-05 10:39:22 +0000 |
1725 | @@ -54,7 +54,7 @@ |
1726 | : m_accessibility(new QPlatformAccessibility()) |
1727 | , m_fontDb(new QGenericUnixFontDatabase()) |
1728 | , m_services(new Services) |
1729 | - , m_mirServer(new QMirServer) |
1730 | + , m_mirServer(QMirServer::create()) |
1731 | , m_nativeInterface(nullptr) |
1732 | { |
1733 | // For access to sensors, qtmir uses qtubuntu-sensors. qtubuntu-sensors reads the |
1734 | |
1735 | === modified file 'src/platforms/mirserver/mirserverintegration.h' |
1736 | --- src/platforms/mirserver/mirserverintegration.h 2017-02-21 18:53:48 +0000 |
1737 | +++ src/platforms/mirserver/mirserverintegration.h 2017-04-05 10:39:22 +0000 |
1738 | @@ -20,6 +20,7 @@ |
1739 | // qt |
1740 | #include <qpa/qplatformintegration.h> |
1741 | #include <QScopedPointer> |
1742 | +#include <QSharedPointer> |
1743 | |
1744 | class NativeInterface; |
1745 | class QMirServer; |
1746 | @@ -59,7 +60,7 @@ |
1747 | QScopedPointer<QPlatformFontDatabase> m_fontDb; |
1748 | QScopedPointer<QPlatformServices> m_services; |
1749 | |
1750 | - QScopedPointer<QMirServer> m_mirServer; |
1751 | + QSharedPointer<QMirServer> m_mirServer; |
1752 | |
1753 | NativeInterface *m_nativeInterface; |
1754 | QPlatformInputContext* m_inputContext; |
1755 | |
1756 | === modified file 'src/platforms/mirserver/qmirserver.cpp' |
1757 | --- src/platforms/mirserver/qmirserver.cpp 2017-03-14 13:49:38 +0000 |
1758 | +++ src/platforms/mirserver/qmirserver.cpp 2017-04-05 10:39:22 +0000 |
1759 | @@ -41,10 +41,25 @@ |
1760 | stop(); |
1761 | } |
1762 | |
1763 | +QSharedPointer<QMirServer> QMirServer::create() |
1764 | +{ |
1765 | + static QWeakPointer<QMirServer> server; |
1766 | + if (server.isNull()) { |
1767 | + QSharedPointer<QMirServer> newServer(new QMirServer()); |
1768 | + server = newServer.toWeakRef(); |
1769 | + return newServer; |
1770 | + } |
1771 | + return server.toStrongRef(); |
1772 | +} |
1773 | + |
1774 | void QMirServer::start() |
1775 | { |
1776 | Q_D(QMirServer); |
1777 | |
1778 | + if (d->serverThread->isRunning()) { |
1779 | + return; |
1780 | + } |
1781 | + |
1782 | d->serverThread->start(QThread::TimeCriticalPriority); |
1783 | |
1784 | if (!d->serverThread->waitForMirStartup()) |
1785 | @@ -114,3 +129,39 @@ |
1786 | Q_D(const QMirServer); |
1787 | return d->promptSessionManager(); |
1788 | } |
1789 | + |
1790 | +qtmir::WindowModelNotifier *QMirServer::windowModelNotifier() const |
1791 | +{ |
1792 | + Q_D(const QMirServer); |
1793 | + return d->windowModelNotifier(); |
1794 | +} |
1795 | + |
1796 | +qtmir::AppNotifier *QMirServer::appNotifier() const |
1797 | +{ |
1798 | + Q_D(const QMirServer); |
1799 | + return d->appNotifier(); |
1800 | +} |
1801 | + |
1802 | +void QMirServer::wrapDisplayConfigurationPolicy(qtmir::DisplayConfigurationPolicyWrapper const& setDisplayConfigurationPolicy) |
1803 | +{ |
1804 | + Q_D(QMirServer); |
1805 | + d->m_displayConfigurationPolicy = setDisplayConfigurationPolicy; |
1806 | +} |
1807 | + |
1808 | +void QMirServer::overrideSessionAuthorizer(qtmir::SessionAuthorizerBuilder const& setApplicationAuthorizer) |
1809 | +{ |
1810 | + Q_D(QMirServer); |
1811 | + d->m_wrappedSessionAuthorizer = miral::SetApplicationAuthorizer<WrappedSessionAuthorizer>(setApplicationAuthorizer); |
1812 | +} |
1813 | + |
1814 | +void QMirServer::overrideWindowManagementPolicy(const qtmir::WindowManagmentPolicyBuilder &wmPolicyCreator) |
1815 | +{ |
1816 | + Q_D(QMirServer); |
1817 | + d->m_windowManagementPolicy = wmPolicyCreator; |
1818 | +} |
1819 | + |
1820 | +void QMirServer::overrideDisplayConfigurationStorage(const qtmir::BasicSetDisplayConfigurationStorage &setDisplayConfigStorage) |
1821 | +{ |
1822 | + Q_D(QMirServer); |
1823 | + d->m_displayConfigurationStorage = setDisplayConfigStorage; |
1824 | +} |
1825 | |
1826 | === modified file 'src/platforms/mirserver/qmirserver.h' |
1827 | --- src/platforms/mirserver/qmirserver.h 2017-02-21 18:53:48 +0000 |
1828 | +++ src/platforms/mirserver/qmirserver.h 2017-04-05 10:39:22 +0000 |
1829 | @@ -19,12 +19,23 @@ |
1830 | |
1831 | // Qt |
1832 | #include <QObject> |
1833 | -#include <QWeakPointer> |
1834 | +#include <QSharedPointer> |
1835 | |
1836 | #include <memory> |
1837 | |
1838 | +// local |
1839 | +#include "qtmir/sessionauthorizer.h" |
1840 | +#include "qtmir/windowmanagementpolicy.h" |
1841 | +#include "qtmir/displayconfigurationpolicy.h" |
1842 | +#include "qtmir/displayconfigurationstorage.h" |
1843 | + |
1844 | // qtmir |
1845 | -namespace qtmir { class PromptSessionManager; } |
1846 | +namespace qtmir { |
1847 | + class PromptSessionManager; |
1848 | + class WindowModelNotifier; |
1849 | + class AppNotifier; |
1850 | +} |
1851 | +namespace mir { class Server; } |
1852 | |
1853 | class QMirServerPrivate; |
1854 | class ScreensController; |
1855 | @@ -37,9 +48,10 @@ |
1856 | Q_OBJECT |
1857 | |
1858 | public: |
1859 | - QMirServer(QObject *parent = nullptr); |
1860 | virtual ~QMirServer(); |
1861 | |
1862 | + static QSharedPointer<QMirServer> create(); |
1863 | + |
1864 | void start(); |
1865 | Q_SLOT void stop(); |
1866 | bool isRunning() const; |
1867 | @@ -49,6 +61,14 @@ |
1868 | void *nativeResourceForIntegration(const QByteArray &resource) const; |
1869 | std::shared_ptr<qtmir::PromptSessionManager> thePromptSessionManager() const; |
1870 | |
1871 | + qtmir::WindowModelNotifier *windowModelNotifier() const; |
1872 | + qtmir::AppNotifier *appNotifier() const; |
1873 | + |
1874 | + void wrapDisplayConfigurationPolicy(qtmir::DisplayConfigurationPolicyWrapper const& setDisplayConfigurationPolicy); |
1875 | + void overrideSessionAuthorizer(qtmir::SessionAuthorizerBuilder const& setApplicationAuthorizer); |
1876 | + void overrideWindowManagementPolicy(qtmir::WindowManagmentPolicyBuilder const& wmPolicyCreator); |
1877 | + void overrideDisplayConfigurationStorage(qtmir::BasicSetDisplayConfigurationStorage const& setDisplayConfigStorage); |
1878 | + |
1879 | Q_SIGNALS: |
1880 | void started(); |
1881 | void stopped(); |
1882 | @@ -57,6 +77,7 @@ |
1883 | QMirServerPrivate * const d_ptr; |
1884 | |
1885 | private: |
1886 | + QMirServer(QObject *parent = nullptr); |
1887 | Q_DISABLE_COPY(QMirServer) |
1888 | Q_DECLARE_PRIVATE(QMirServer) |
1889 | }; |
1890 | |
1891 | === modified file 'src/platforms/mirserver/qmirserver_p.cpp' |
1892 | --- src/platforms/mirserver/qmirserver_p.cpp 2017-04-05 10:39:22 +0000 |
1893 | +++ src/platforms/mirserver/qmirserver_p.cpp 2017-04-05 10:39:22 +0000 |
1894 | @@ -15,14 +15,15 @@ |
1895 | */ |
1896 | |
1897 | #include "qmirserver_p.h" |
1898 | -#include "miral/display_configuration_storage.h" |
1899 | +#include "qtmir/miral/display_configuration_storage.h" |
1900 | |
1901 | // local |
1902 | #include "logging.h" |
1903 | -#include "mirdisplayconfigurationpolicy.h" |
1904 | -#include "windowmanagementpolicy.h" |
1905 | +#include "wrappedwindowmanagementpolicy.h" |
1906 | #include "promptsessionmanager.h" |
1907 | #include "setqtcompositor.h" |
1908 | +#include "qteventfeeder.h" |
1909 | +#include "qtmir/sessionauthorizer.h" |
1910 | |
1911 | // prototyping for later incorporation in miral |
1912 | #include <miral/persist_display_config.h> |
1913 | @@ -30,12 +31,6 @@ |
1914 | // miral |
1915 | #include <miral/add_init_callback.h> |
1916 | #include <miral/set_terminator.h> |
1917 | -#include <miral/version.h> |
1918 | -#if MIRAL_VERSION > MIR_VERSION_NUMBER(1,3,1) |
1919 | -#include <miral/set_window_management_policy.h> |
1920 | -#else |
1921 | -#include <miral/set_window_managment_policy.h> |
1922 | -#endif |
1923 | |
1924 | // Qt |
1925 | #include <QCoreApplication> |
1926 | @@ -48,12 +43,42 @@ |
1927 | static int qtmirArgc{1}; |
1928 | static const char *qtmirArgv[]{"qtmir"}; |
1929 | |
1930 | +class DefaultWindowManagementPolicy : public qtmir::WindowManagementPolicy |
1931 | +{ |
1932 | +public: |
1933 | + DefaultWindowManagementPolicy(const miral::WindowManagerTools &tools, std::shared_ptr<qtmir::WindowManagementPolicyPrivate> dd) |
1934 | + : qtmir::WindowManagementPolicy(tools, dd) |
1935 | + {} |
1936 | +}; |
1937 | + |
1938 | struct DefaultDisplayConfigurationStorage : miral::DisplayConfigurationStorage |
1939 | { |
1940 | void save(const miral::DisplayId&, const miral::DisplayConfigurationOptions&) override {} |
1941 | |
1942 | bool load(const miral::DisplayId&, miral::DisplayConfigurationOptions&) const override { return false; } |
1943 | }; |
1944 | + |
1945 | +std::shared_ptr<miral::DisplayConfigurationPolicy> buildDisplayConfigurationPolicy() |
1946 | +{ |
1947 | + return std::make_shared<qtmir::DisplayConfigurationPolicy>(); |
1948 | +} |
1949 | + |
1950 | +std::shared_ptr<miral::DisplayConfigurationStorage> buildDisplayConfigurationStorage() |
1951 | +{ |
1952 | + return std::make_shared<DefaultDisplayConfigurationStorage>(); |
1953 | +} |
1954 | + |
1955 | +std::shared_ptr<qtmir::WindowManagementPolicy> buildWindowManagementPolicy(const miral::WindowManagerTools &tools, |
1956 | + std::shared_ptr<qtmir::WindowManagementPolicyPrivate> dd) |
1957 | +{ |
1958 | + return std::make_shared<DefaultWindowManagementPolicy>(tools, dd); |
1959 | +} |
1960 | + |
1961 | +std::shared_ptr<qtmir::SessionAuthorizer> buildSessionAuthorizer() |
1962 | +{ |
1963 | + return std::make_shared<qtmir::SessionAuthorizer>(); |
1964 | +} |
1965 | + |
1966 | } // namespace |
1967 | |
1968 | void MirServerThread::run() |
1969 | @@ -89,8 +114,18 @@ |
1970 | return std::make_shared<qtmir::PromptSessionManager>(m_mirServerHooks.thePromptSessionManager()); |
1971 | } |
1972 | |
1973 | -QMirServerPrivate::QMirServerPrivate() : |
1974 | - runner(qtmirArgc, qtmirArgv) |
1975 | +std::shared_ptr<qtmir::SessionAuthorizer> QMirServerPrivate::theApplicationAuthorizer() const |
1976 | +{ |
1977 | + auto wrapped = m_wrappedSessionAuthorizer.the_custom_application_authorizer(); |
1978 | + return wrapped ? wrapped->wrapper() : nullptr; |
1979 | +} |
1980 | + |
1981 | +QMirServerPrivate::QMirServerPrivate() |
1982 | + : m_displayConfigurationPolicy(buildDisplayConfigurationPolicy) |
1983 | + , m_windowManagementPolicy(buildWindowManagementPolicy) |
1984 | + , m_displayConfigurationStorage(buildDisplayConfigurationStorage) |
1985 | + , m_wrappedSessionAuthorizer(buildSessionAuthorizer) |
1986 | + , runner(qtmirArgc, qtmirArgv) |
1987 | { |
1988 | } |
1989 | |
1990 | @@ -139,18 +174,24 @@ |
1991 | screensController.clear(); |
1992 | }); |
1993 | |
1994 | + auto eventFeeder = std::make_shared<QtEventFeeder>(screensModel); |
1995 | + auto displayStorageBuilder = m_displayConfigurationStorage.builder(); |
1996 | + |
1997 | runner.run_with( |
1998 | { |
1999 | - m_sessionAuthorizer, |
2000 | + m_wrappedSessionAuthorizer, |
2001 | m_openGLContextFactory, |
2002 | m_mirServerHooks, |
2003 | - miral::set_window_management_policy<WindowManagementPolicy>(m_windowModelNotifier, m_windowController, |
2004 | - m_appNotifier, screensModel), |
2005 | + miral::set_window_management_policy<WrappedWindowManagementPolicy>(m_windowModelNotifier, |
2006 | + m_windowController, |
2007 | + m_appNotifier, |
2008 | + eventFeeder, |
2009 | + m_windowManagementPolicy), |
2010 | addInitCallback, |
2011 | qtmir::SetQtCompositor{screensModel}, |
2012 | setTerminator, |
2013 | - miral::PersistDisplayConfig{std::make_shared<DefaultDisplayConfigurationStorage>(), |
2014 | - &qtmir::wrapDisplayConfigurationPolicy} |
2015 | + miral::PersistDisplayConfig{displayStorageBuilder(), |
2016 | + m_displayConfigurationPolicy} |
2017 | }); |
2018 | } |
2019 | |
2020 | |
2021 | === modified file 'src/platforms/mirserver/qmirserver_p.h' |
2022 | --- src/platforms/mirserver/qmirserver_p.h 2017-02-21 18:53:48 +0000 |
2023 | +++ src/platforms/mirserver/qmirserver_p.h 2017-04-05 10:39:22 +0000 |
2024 | @@ -31,19 +31,23 @@ |
2025 | #include "screensmodel.h" |
2026 | #include "windowcontroller.h" |
2027 | #include "windowmodelnotifier.h" |
2028 | -#include "sessionauthorizer.h" |
2029 | #include "mirserverhooks.h" |
2030 | +#include "wrappedsessionauthorizer.h" |
2031 | +#include "qtmir/displayconfigurationpolicy.h" |
2032 | +#include "qtmir/windowmanagementpolicy.h" |
2033 | +#include "qtmir/displayconfigurationstorage.h" |
2034 | |
2035 | //miral |
2036 | -#include <miral/application_authorizer.h> |
2037 | #include <miral/runner.h> |
2038 | +#include <QDebug> |
2039 | |
2040 | class MirServerThread; |
2041 | class QOpenGLContext; |
2042 | +class QMirServer; |
2043 | |
2044 | namespace qtmir |
2045 | { |
2046 | -using SetSessionAuthorizer = miral::SetApplicationAuthorizer<SessionAuthorizer>; |
2047 | +class SessionAuthorizer; |
2048 | class PromptSessionManager; |
2049 | } |
2050 | |
2051 | @@ -63,8 +67,7 @@ |
2052 | PromptSessionListener *promptSessionListener() const; |
2053 | std::shared_ptr<qtmir::PromptSessionManager> promptSessionManager() const; |
2054 | |
2055 | - std::shared_ptr<SessionAuthorizer> theApplicationAuthorizer() const |
2056 | - { return m_sessionAuthorizer.the_custom_application_authorizer(); } |
2057 | + std::shared_ptr<qtmir::SessionAuthorizer> theApplicationAuthorizer() const; |
2058 | |
2059 | qtmir::WindowModelNotifier *windowModelNotifier() const |
2060 | { return &m_windowModelNotifier; } |
2061 | @@ -75,8 +78,11 @@ |
2062 | qtmir::WindowControllerInterface *windowController() const |
2063 | { return &m_windowController; } |
2064 | |
2065 | + qtmir::DisplayConfigurationPolicyWrapper m_displayConfigurationPolicy; |
2066 | + qtmir::WindowManagmentPolicyBuilder m_windowManagementPolicy; |
2067 | + qtmir::BasicSetDisplayConfigurationStorage m_displayConfigurationStorage; |
2068 | + miral::SetApplicationAuthorizer<WrappedSessionAuthorizer> m_wrappedSessionAuthorizer; |
2069 | private: |
2070 | - qtmir::SetSessionAuthorizer m_sessionAuthorizer; |
2071 | qtmir::OpenGLContextFactory m_openGLContextFactory; |
2072 | qtmir::MirServerHooks m_mirServerHooks; |
2073 | |
2074 | |
2075 | === added file 'src/platforms/mirserver/qtmirserver.pc.in' |
2076 | --- src/platforms/mirserver/qtmirserver.pc.in 1970-01-01 00:00:00 +0000 |
2077 | +++ src/platforms/mirserver/qtmirserver.pc.in 2017-04-05 10:39:22 +0000 |
2078 | @@ -0,0 +1,9 @@ |
2079 | +libdir=@LIBDIR@ |
2080 | +includedir=@INCLUDEDIR@ |
2081 | + |
2082 | +Name: qtmirserver |
2083 | +Description: QtMir server library |
2084 | +Version: @QTMIR_VERSION@ |
2085 | +Requires: miral >= 1.1 |
2086 | +Libs: -L${libdir} -lqtmirserver |
2087 | +Cflags: -I${includedir} |
2088 | |
2089 | === modified file 'src/platforms/mirserver/screensmodel.cpp' |
2090 | --- src/platforms/mirserver/screensmodel.cpp 2017-01-18 18:30:14 +0000 |
2091 | +++ src/platforms/mirserver/screensmodel.cpp 2017-04-05 10:39:22 +0000 |
2092 | @@ -19,7 +19,6 @@ |
2093 | #include "screenwindow.h" |
2094 | #include "qtcompositor.h" |
2095 | #include "logging.h" |
2096 | -#include "mirserverintegration.h" |
2097 | #include "screen.h" |
2098 | #include "mirqtconversion.h" |
2099 | |
2100 | @@ -166,7 +165,7 @@ |
2101 | if (window && window->window() && window->isExposed()) { |
2102 | window->window()->hide(); |
2103 | } |
2104 | - bool ok = QMetaObject::invokeMethod(qApp, "onScreenAboutToBeRemoved", Qt::DirectConnection, Q_ARG(QScreen*, screen->screen())); |
2105 | + bool ok = QMetaObject::invokeMethod(qApp, "screenAboutToBeRemoved", Qt::DirectConnection, Q_ARG(QScreen*, screen->screen())); |
2106 | if (!ok) { |
2107 | qCWarning(QTMIR_SCREENS) << "Failed to invoke QGuiApplication::onScreenAboutToBeRemoved(QScreen*) slot."; |
2108 | } |
2109 | |
2110 | === modified file 'src/platforms/mirserver/windowcontroller.cpp' |
2111 | --- src/platforms/mirserver/windowcontroller.cpp 2017-03-16 16:59:09 +0000 |
2112 | +++ src/platforms/mirserver/windowcontroller.cpp 2017-04-05 10:39:22 +0000 |
2113 | @@ -15,8 +15,8 @@ |
2114 | */ |
2115 | |
2116 | #include "windowcontroller.h" |
2117 | +#include "wrappedwindowmanagementpolicy.h" |
2118 | |
2119 | -#include "windowmanagementpolicy.h" |
2120 | #include "mirqtconversion.h" |
2121 | |
2122 | using namespace qtmir; |
2123 | @@ -111,7 +111,7 @@ |
2124 | } |
2125 | } |
2126 | |
2127 | -void WindowController::setPolicy(WindowManagementPolicy * const policy) |
2128 | +void WindowController::setPolicy(WrappedWindowManagementPolicy * const policy) |
2129 | { |
2130 | m_policy = policy; |
2131 | } |
2132 | |
2133 | === modified file 'src/platforms/mirserver/windowcontroller.h' |
2134 | --- src/platforms/mirserver/windowcontroller.h 2017-03-21 10:30:57 +0000 |
2135 | +++ src/platforms/mirserver/windowcontroller.h 2017-04-05 10:39:22 +0000 |
2136 | @@ -19,11 +19,11 @@ |
2137 | |
2138 | #include "windowcontrollerinterface.h" |
2139 | |
2140 | -class WindowManagementPolicy; |
2141 | +class WrappedWindowManagementPolicy; |
2142 | |
2143 | namespace qtmir { |
2144 | |
2145 | -class WindowController : public WindowControllerInterface |
2146 | +class WindowController : public qtmir::WindowControllerInterface |
2147 | { |
2148 | public: |
2149 | WindowController(); |
2150 | @@ -46,10 +46,10 @@ |
2151 | void setWindowConfinementRegions(const QVector<QRect> ®ions) override; |
2152 | void setWindowMargins(Mir::Type windowType, const QMargins &margins) override; |
2153 | |
2154 | - void setPolicy(WindowManagementPolicy *policy); |
2155 | + void setPolicy(WrappedWindowManagementPolicy *policy); |
2156 | |
2157 | protected: |
2158 | - WindowManagementPolicy *m_policy; |
2159 | + WrappedWindowManagementPolicy *m_policy; |
2160 | }; |
2161 | |
2162 | } // namespace qtmir |
2163 | |
2164 | === renamed file 'src/platforms/mirserver/sessionauthorizer.cpp' => 'src/platforms/mirserver/wrappedsessionauthorizer.cpp' |
2165 | --- src/platforms/mirserver/sessionauthorizer.cpp 2017-01-26 14:34:08 +0000 |
2166 | +++ src/platforms/mirserver/wrappedsessionauthorizer.cpp 2017-04-05 10:39:22 +0000 |
2167 | @@ -1,5 +1,5 @@ |
2168 | /* |
2169 | - * Copyright (C) 2013-2015 Canonical, Ltd. |
2170 | + * Copyright (C) 2016 Canonical, Ltd. |
2171 | * |
2172 | * This program is free software: you can redistribute it and/or modify it under |
2173 | * the terms of the GNU Lesser General Public License version 3, as published by |
2174 | @@ -14,81 +14,143 @@ |
2175 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2176 | */ |
2177 | |
2178 | -#include "sessionauthorizer.h" |
2179 | +#include "wrappedsessionauthorizer.h" |
2180 | +#include "qmirserver.h" |
2181 | #include "logging.h" |
2182 | #include "tracepoints.h" // generated from tracepoints.tp |
2183 | |
2184 | #include <QMetaMethod> |
2185 | #include <QThread> |
2186 | |
2187 | -SessionAuthorizer::SessionAuthorizer(QObject *parent) |
2188 | - : QObject(parent) |
2189 | - , m_connectionChecked(false) |
2190 | -{ |
2191 | -} |
2192 | - |
2193 | -SessionAuthorizer::~SessionAuthorizer() |
2194 | -{ |
2195 | -} |
2196 | - |
2197 | -bool SessionAuthorizer::connection_is_allowed(miral::ApplicationCredentials const& creds) |
2198 | -{ |
2199 | - tracepoint(qtmirserver, sessionAuthorizeStart); |
2200 | - qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::connection_is_allowed - this=" << this << "pid=" << creds.pid(); |
2201 | - bool authorized = true; |
2202 | - |
2203 | - if (!m_connectionChecked) { |
2204 | - // Wait until the ApplicationManager is ready to receive requestAuthorizationForSession signals |
2205 | - QMetaMethod mm = QMetaMethod::fromSignal(&SessionAuthorizer::requestAuthorizationForSession); |
2206 | - for (int i = 0; i < 100 && !isSignalConnected(mm); ++i) { |
2207 | - QThread::usleep(10000); |
2208 | - } |
2209 | - if (!isSignalConnected(mm)) { |
2210 | - qCDebug(QTMIR_MIR_MESSAGES) << |
2211 | - "SessionAuthorizer::connection_is_allowed - Gave up waiting for signal listeners"; |
2212 | - } |
2213 | - m_connectionChecked = true; |
2214 | - } |
2215 | - |
2216 | - Q_EMIT requestAuthorizationForSession(creds.pid(), authorized); // needs to block until authorized value returned |
2217 | - tracepoint(qtmirserver, sessionAuthorizeEnd); |
2218 | - |
2219 | - return authorized; |
2220 | -} |
2221 | - |
2222 | -bool SessionAuthorizer::configure_display_is_allowed(miral::ApplicationCredentials const& creds) |
2223 | -{ |
2224 | - qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::configure_display_is_allowed - this=" << this << "pid=" << creds.pid(); |
2225 | - |
2226 | - //FIXME(ricmm) Actually mediate this access for clients |
2227 | - Q_UNUSED(creds) |
2228 | - return true; |
2229 | -} |
2230 | - |
2231 | -bool SessionAuthorizer::screencast_is_allowed(miral::ApplicationCredentials const& creds) |
2232 | -{ |
2233 | - qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::screencast_is_allowed - this=" << this << "pid=" << creds.pid(); |
2234 | - |
2235 | - //FIXME Actually mediate this access for clients |
2236 | - Q_UNUSED(creds) |
2237 | - return true; |
2238 | -} |
2239 | - |
2240 | -bool SessionAuthorizer::prompt_session_is_allowed(miral::ApplicationCredentials const& creds) |
2241 | -{ |
2242 | - qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::prompt_session_is_allowed - this=" << this << "pid=" << creds.pid(); |
2243 | - |
2244 | - //FIXME Actually mediate this access for clients |
2245 | - Q_UNUSED(creds) |
2246 | - return true; |
2247 | -} |
2248 | - |
2249 | -bool SessionAuthorizer::set_base_display_configuration_is_allowed(miral::ApplicationCredentials const& creds) |
2250 | -{ |
2251 | - qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::set_base_display_configuration_is_allowed - this=" |
2252 | - << this << "pid=" << creds.pid(); |
2253 | - |
2254 | - //FIXME Actually mediate this access for clients |
2255 | - Q_UNUSED(creds) |
2256 | - return true; |
2257 | +namespace qtmir { |
2258 | + |
2259 | + struct SessionAuthorizer::Private |
2260 | + { |
2261 | + bool m_connectionChecked{false}; |
2262 | + }; |
2263 | + |
2264 | + SessionAuthorizer::SessionAuthorizer() |
2265 | + : d(new SessionAuthorizer::Private) |
2266 | + { |
2267 | + } |
2268 | + |
2269 | + SessionAuthorizer::~SessionAuthorizer() |
2270 | + { |
2271 | + } |
2272 | + |
2273 | + bool SessionAuthorizer::connectionIsAllowed(miral::ApplicationCredentials const& creds) |
2274 | + { |
2275 | + tracepoint(qtmirserver, sessionAuthorizeStart); |
2276 | + qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::connection_is_allowed - this=" << this << "pid=" << creds.pid(); |
2277 | + bool authorized = true; |
2278 | + |
2279 | + if (!d->m_connectionChecked) { |
2280 | + // Wait until the ApplicationManager is ready to receive requestAuthorizationForSession signals |
2281 | + QMetaMethod mm = QMetaMethod::fromSignal(&SessionAuthorizer::requestAuthorizationForSession); |
2282 | + for (int i = 0; i < 100 && !isSignalConnected(mm); ++i) { |
2283 | + QThread::usleep(10000); |
2284 | + } |
2285 | + if (!isSignalConnected(mm)) { |
2286 | + qCDebug(QTMIR_MIR_MESSAGES) << |
2287 | + "SessionAuthorizer::connection_is_allowed - Gave up waiting for signal listeners"; |
2288 | + } |
2289 | + d->m_connectionChecked = true; |
2290 | + } |
2291 | + |
2292 | + Q_EMIT requestAuthorizationForSession(creds.pid(), authorized); // needs to block until authorized value returned |
2293 | + tracepoint(qtmirserver, sessionAuthorizeEnd); |
2294 | + |
2295 | + return authorized; |
2296 | + } |
2297 | + |
2298 | + bool SessionAuthorizer::configureDisplayIsAllowed(miral::ApplicationCredentials const& creds) |
2299 | + { |
2300 | + qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::configure_display_is_allowed - this=" << this << "pid=" << creds.pid(); |
2301 | + |
2302 | + //FIXME(ricmm) Actually mediate this access for clients |
2303 | + Q_UNUSED(creds) |
2304 | + return true; |
2305 | + } |
2306 | + |
2307 | + bool SessionAuthorizer::setBaseDisplayConfigurationIsAllowed(miral::ApplicationCredentials const& creds) |
2308 | + { |
2309 | + qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::screencast_is_allowed - this=" << this << "pid=" << creds.pid(); |
2310 | + |
2311 | + //FIXME Actually mediate this access for clients |
2312 | + Q_UNUSED(creds) |
2313 | + return true; |
2314 | + } |
2315 | + |
2316 | + bool SessionAuthorizer::screencastIsAllowed(miral::ApplicationCredentials const& creds) |
2317 | + { |
2318 | + qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::prompt_session_is_allowed - this=" << this << "pid=" << creds.pid(); |
2319 | + |
2320 | + //FIXME Actually mediate this access for clients |
2321 | + Q_UNUSED(creds) |
2322 | + return true; |
2323 | + } |
2324 | + |
2325 | + bool SessionAuthorizer::promptSessionIsAllowed(miral::ApplicationCredentials const& creds) |
2326 | + { |
2327 | + qCDebug(QTMIR_MIR_MESSAGES) << "SessionAuthorizer::set_base_display_configuration_is_allowed - this=" |
2328 | + << this << "pid=" << creds.pid(); |
2329 | + |
2330 | + //FIXME Actually mediate this access for clients |
2331 | + Q_UNUSED(creds) |
2332 | + return true; |
2333 | + } |
2334 | + |
2335 | + |
2336 | + struct BasicSetSessionAuthorizer::Private |
2337 | + { |
2338 | + Private(qtmir::SessionAuthorizerBuilder const& builder) : |
2339 | + builder{builder} {} |
2340 | + |
2341 | + qtmir::SessionAuthorizerBuilder builder; |
2342 | + }; |
2343 | + |
2344 | + BasicSetSessionAuthorizer::BasicSetSessionAuthorizer(qtmir::SessionAuthorizerBuilder const& builder) |
2345 | + : d(new BasicSetSessionAuthorizer::Private(builder)) |
2346 | + { |
2347 | + } |
2348 | + |
2349 | + void BasicSetSessionAuthorizer::operator()(QMirServer &server) |
2350 | + { |
2351 | + server.overrideSessionAuthorizer(d->builder); |
2352 | + } |
2353 | + |
2354 | + SessionAuthorizerBuilder qtmir::BasicSetSessionAuthorizer::builder() const |
2355 | + { |
2356 | + return d->builder; |
2357 | + } |
2358 | +} |
2359 | + |
2360 | +WrappedSessionAuthorizer::WrappedSessionAuthorizer(const qtmir::SessionAuthorizerBuilder &builder) |
2361 | + : impl(builder()) |
2362 | +{ |
2363 | +} |
2364 | + |
2365 | +bool WrappedSessionAuthorizer::connection_is_allowed(const miral::ApplicationCredentials &creds) |
2366 | +{ |
2367 | + return impl->connectionIsAllowed(creds); |
2368 | +} |
2369 | + |
2370 | +bool WrappedSessionAuthorizer::configure_display_is_allowed(const miral::ApplicationCredentials &creds) |
2371 | +{ |
2372 | + return impl->configureDisplayIsAllowed(creds); |
2373 | +} |
2374 | + |
2375 | +bool WrappedSessionAuthorizer::set_base_display_configuration_is_allowed(const miral::ApplicationCredentials &creds) |
2376 | +{ |
2377 | + return impl->setBaseDisplayConfigurationIsAllowed(creds); |
2378 | +} |
2379 | + |
2380 | +bool WrappedSessionAuthorizer::screencast_is_allowed(const miral::ApplicationCredentials &creds) |
2381 | +{ |
2382 | + return impl->screencastIsAllowed(creds); |
2383 | +} |
2384 | + |
2385 | +bool WrappedSessionAuthorizer::prompt_session_is_allowed(const miral::ApplicationCredentials &creds) |
2386 | +{ |
2387 | + return impl->promptSessionIsAllowed(creds); |
2388 | } |
2389 | |
2390 | === added file 'src/platforms/mirserver/wrappedsessionauthorizer.h' |
2391 | --- src/platforms/mirserver/wrappedsessionauthorizer.h 1970-01-01 00:00:00 +0000 |
2392 | +++ src/platforms/mirserver/wrappedsessionauthorizer.h 2017-04-05 10:39:22 +0000 |
2393 | @@ -0,0 +1,39 @@ |
2394 | +/* |
2395 | + * Copyright (C) 2016 Canonical, Ltd. |
2396 | + * |
2397 | + * This program is free software: you can redistribute it and/or modify it under |
2398 | + * the terms of the GNU Lesser General Public License version 3, as published by |
2399 | + * the Free Software Foundation. |
2400 | + * |
2401 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
2402 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
2403 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2404 | + * Lesser General Public License for more details. |
2405 | + * |
2406 | + * You should have received a copy of the GNU Lesser General Public License |
2407 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2408 | + */ |
2409 | + |
2410 | +#ifndef WRAPPEDSESSIONAUTHORIZER_H |
2411 | +#define WRAPPEDSESSIONAUTHORIZER_H |
2412 | + |
2413 | +#include "qtmir/sessionauthorizer.h" |
2414 | + |
2415 | +class WrappedSessionAuthorizer : public miral::ApplicationAuthorizer |
2416 | +{ |
2417 | +public: |
2418 | + WrappedSessionAuthorizer(qtmir::SessionAuthorizerBuilder const& builder); |
2419 | + |
2420 | + virtual bool connection_is_allowed(miral::ApplicationCredentials const& creds) override; |
2421 | + virtual bool configure_display_is_allowed(miral::ApplicationCredentials const& creds) override; |
2422 | + virtual bool set_base_display_configuration_is_allowed(miral::ApplicationCredentials const& creds) override; |
2423 | + virtual bool screencast_is_allowed(miral::ApplicationCredentials const& creds) override; |
2424 | + virtual bool prompt_session_is_allowed(miral::ApplicationCredentials const& creds) override; |
2425 | + |
2426 | + std::shared_ptr<qtmir::SessionAuthorizer> wrapper() { return impl; } |
2427 | + |
2428 | +private: |
2429 | + std::shared_ptr<qtmir::SessionAuthorizer> impl; |
2430 | +}; |
2431 | + |
2432 | +#endif // WRAPPEDSESSIONAUTHORIZER_H |
2433 | |
2434 | === renamed file 'src/platforms/mirserver/windowmanagementpolicy.cpp' => 'src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp' |
2435 | --- src/platforms/mirserver/windowmanagementpolicy.cpp 2017-03-24 11:29:56 +0000 |
2436 | +++ src/platforms/mirserver/wrappedwindowmanagementpolicy.cpp 2017-04-05 10:39:22 +0000 |
2437 | @@ -14,7 +14,7 @@ |
2438 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2439 | */ |
2440 | |
2441 | -#include "windowmanagementpolicy.h" |
2442 | +#include "wrappedwindowmanagementpolicy.h" |
2443 | |
2444 | #include "eventdispatch.h" |
2445 | #include "initialsurfacesizes.h" |
2446 | @@ -25,26 +25,297 @@ |
2447 | #include "miral/window_specification.h" |
2448 | |
2449 | #include "mirqtconversion.h" |
2450 | +#include "qmirserver.h" |
2451 | #include "tracepoints.h" |
2452 | |
2453 | -namespace qtmir { |
2454 | +#include <QDebug> |
2455 | + |
2456 | +using namespace mir::geometry; |
2457 | + |
2458 | +namespace qtmir |
2459 | +{ |
2460 | std::shared_ptr<ExtraWindowInfo> getExtraInfo(const miral::WindowInfo &windowInfo) { |
2461 | return std::static_pointer_cast<ExtraWindowInfo>(windowInfo.userdata()); |
2462 | } |
2463 | + |
2464 | + struct BasicSetWindowManagementPolicy::Private |
2465 | + { |
2466 | + Private(WindowManagmentPolicyBuilder const& builder) : |
2467 | + builder{builder} {} |
2468 | + |
2469 | + WindowManagmentPolicyBuilder builder; |
2470 | + }; |
2471 | + |
2472 | + BasicSetWindowManagementPolicy::BasicSetWindowManagementPolicy(WindowManagmentPolicyBuilder const& builder) |
2473 | + : d(new BasicSetWindowManagementPolicy::Private(builder)) |
2474 | + { |
2475 | + } |
2476 | + |
2477 | + void BasicSetWindowManagementPolicy::operator()(QMirServer &server) |
2478 | + { |
2479 | + server.overrideWindowManagementPolicy(d->builder); |
2480 | + } |
2481 | + |
2482 | + WindowManagmentPolicyBuilder BasicSetWindowManagementPolicy::builder() const |
2483 | + { |
2484 | + return d->builder; |
2485 | + } |
2486 | + |
2487 | + struct WindowManagementPolicyPrivate |
2488 | + { |
2489 | + WindowManagementPolicyPrivate(qtmir::WindowModelNotifier &windowModel, |
2490 | + qtmir::AppNotifier &appNotifier, |
2491 | + const std::shared_ptr<QtEventFeeder>& eventFeeder) |
2492 | + : m_windowModel(windowModel) |
2493 | + , m_appNotifier(appNotifier) |
2494 | + , m_eventFeeder(eventFeeder) |
2495 | + {} |
2496 | + |
2497 | + QRect getConfinementRect(const QRect rect) const |
2498 | + { |
2499 | + QRect confinementRect; |
2500 | + for (const QRect r : m_confinementRegions) { |
2501 | + if (r.intersects(rect)) { |
2502 | + confinementRect = r; |
2503 | + // TODO: What if there are multiple confinement regions and they intersect?? |
2504 | + break; |
2505 | + } |
2506 | + } |
2507 | + return confinementRect; |
2508 | + } |
2509 | + |
2510 | + qtmir::WindowModelNotifier &m_windowModel; |
2511 | + qtmir::AppNotifier &m_appNotifier; |
2512 | + const std::shared_ptr<QtEventFeeder> m_eventFeeder; |
2513 | + |
2514 | + QVector<QRect> m_confinementRegions; |
2515 | + QMargins m_windowMargins[mir_window_types]; |
2516 | + }; |
2517 | + |
2518 | + WindowManagementPolicy::WindowManagementPolicy(const miral::WindowManagerTools &tools, std::shared_ptr<qtmir::WindowManagementPolicyPrivate> dd) |
2519 | + : miral::CanonicalWindowManagerPolicy(tools) |
2520 | + , d(dd) |
2521 | + { |
2522 | + } |
2523 | + |
2524 | + miral::WindowSpecification WindowManagementPolicy::place_new_window( |
2525 | + const miral::ApplicationInfo &appInfo, |
2526 | + const miral::WindowSpecification &requestParameters) |
2527 | + { |
2528 | + auto parameters = CanonicalWindowManagerPolicy::place_new_window(appInfo, requestParameters); |
2529 | + |
2530 | + if (!requestParameters.parent().is_set() || requestParameters.parent().value().lock().get() == nullptr) { |
2531 | + |
2532 | + int surfaceType = requestParameters.type().is_set() ? requestParameters.type().value() : -1; |
2533 | + |
2534 | + QSize initialSize = InitialSurfaceSizes::get(miral::pid_of(appInfo.application())); |
2535 | + |
2536 | + if (initialSize.isValid() && surfaceType == mir_surface_type_normal) { |
2537 | + parameters.size() = toMirSize(initialSize); |
2538 | + } |
2539 | + } |
2540 | + |
2541 | + parameters.userdata() = std::make_shared<ExtraWindowInfo>(); |
2542 | + |
2543 | + return parameters; |
2544 | + } |
2545 | + |
2546 | + void WindowManagementPolicy::handle_window_ready(miral::WindowInfo &windowInfo) |
2547 | + { |
2548 | + CanonicalWindowManagerPolicy::handle_window_ready(windowInfo); |
2549 | + |
2550 | + Q_EMIT d->m_windowModel.windowReady(windowInfo); |
2551 | + |
2552 | + auto appInfo = tools.info_for(windowInfo.window().application()); |
2553 | + Q_EMIT d->m_appNotifier.appCreatedWindow(appInfo); |
2554 | + } |
2555 | + |
2556 | + void WindowManagementPolicy::handle_modify_window(miral::WindowInfo &windowInfo, |
2557 | + const miral::WindowSpecification &modificationsClient) |
2558 | + { |
2559 | + miral::WindowSpecification modifications(modificationsClient); |
2560 | + |
2561 | + if (modifications.size().is_set()) { |
2562 | + auto extraWindowInfo = qtmir::getExtraInfo(windowInfo); |
2563 | + QMutexLocker locker(&extraWindowInfo->mutex); |
2564 | + if (!extraWindowInfo->allowClientResize) { |
2565 | + modifications.size().consume(); |
2566 | + } |
2567 | + } |
2568 | + |
2569 | + CanonicalWindowManagerPolicy::handle_modify_window(windowInfo, modifications); |
2570 | + |
2571 | + // TODO Once Qt processes the request we probably don't want to notify from here |
2572 | + std::shared_ptr<mir::scene::Surface> surface{windowInfo.window()}; |
2573 | + if (SurfaceObserver *observer = SurfaceObserver::observerForSurface(surface.get())) { |
2574 | + observer->notifySurfaceModifications(modifications); |
2575 | + } |
2576 | + } |
2577 | + |
2578 | + void WindowManagementPolicy::handle_raise_window(miral::WindowInfo &windowInfo) |
2579 | + { |
2580 | + CanonicalWindowManagerPolicy::handle_raise_window(windowInfo); |
2581 | + |
2582 | + Q_EMIT d->m_windowModel.windowRequestedRaise(windowInfo); |
2583 | + } |
2584 | + |
2585 | + bool WindowManagementPolicy::handle_keyboard_event(const MirKeyboardEvent *event) |
2586 | + { |
2587 | + d->m_eventFeeder->dispatchKey(event); |
2588 | + return true; |
2589 | + } |
2590 | + |
2591 | + bool WindowManagementPolicy::handle_touch_event(const MirTouchEvent *event) |
2592 | + { |
2593 | + d->m_eventFeeder->dispatchTouch(event); |
2594 | + return true; |
2595 | + } |
2596 | + |
2597 | + bool WindowManagementPolicy::handle_pointer_event(const MirPointerEvent *event) |
2598 | + { |
2599 | + d->m_eventFeeder->dispatchPointer(event); |
2600 | + return true; |
2601 | + } |
2602 | + |
2603 | + void WindowManagementPolicy::advise_begin() |
2604 | + { |
2605 | + Q_EMIT d->m_windowModel.modificationsStarted(); |
2606 | + } |
2607 | + |
2608 | + void WindowManagementPolicy::advise_end() |
2609 | + { |
2610 | + Q_EMIT d->m_windowModel.modificationsEnded(); |
2611 | + } |
2612 | + |
2613 | + void WindowManagementPolicy::advise_new_app(miral::ApplicationInfo &application) |
2614 | + { |
2615 | + Q_EMIT d->m_appNotifier.appAdded(application); |
2616 | + } |
2617 | + |
2618 | + void WindowManagementPolicy::advise_delete_app(const miral::ApplicationInfo &application) |
2619 | + { |
2620 | + Q_EMIT d->m_appNotifier.appRemoved(application); |
2621 | + } |
2622 | + |
2623 | + void WindowManagementPolicy::advise_new_window(const miral::WindowInfo &windowInfo) |
2624 | + { |
2625 | + // TODO: attach surface observer here |
2626 | + |
2627 | + getExtraInfo(windowInfo)->persistentId = QString::fromStdString(tools.id_for_window(windowInfo.window())); |
2628 | + |
2629 | + // FIXME: remove when possible |
2630 | + getExtraInfo(windowInfo)->state = toQtState(windowInfo.state()); |
2631 | + |
2632 | + Q_EMIT d->m_windowModel.windowAdded(NewWindow{windowInfo}); |
2633 | + } |
2634 | + |
2635 | + void WindowManagementPolicy::advise_focus_lost(const miral::WindowInfo &windowInfo) |
2636 | + { |
2637 | + Q_EMIT d->m_windowModel.windowFocusChanged(windowInfo, false); |
2638 | + } |
2639 | + |
2640 | + void WindowManagementPolicy::advise_focus_gained(const miral::WindowInfo &windowInfo) |
2641 | + { |
2642 | + // update Qt model ASAP, before applying Mir policy |
2643 | + Q_EMIT d->m_windowModel.windowFocusChanged(windowInfo, true); |
2644 | + |
2645 | + CanonicalWindowManagerPolicy::advise_focus_gained(windowInfo); |
2646 | + } |
2647 | + |
2648 | + void WindowManagementPolicy::advise_state_change(const miral::WindowInfo &windowInfo, MirWindowState state) |
2649 | + { |
2650 | + auto extraWinInfo = getExtraInfo(windowInfo); |
2651 | + |
2652 | + // FIXME: Remove this mess once MirWindowState matches Mir::State |
2653 | + if (state == mir_window_state_restored && extraWinInfo->state != Mir::RestoredState |
2654 | + && toMirState(extraWinInfo->state) == state) { |
2655 | + // Ignore. That MirWindowState is just a placeholder for a Mir::State value that has no counterpart |
2656 | + // in MirWindowState. |
2657 | + } else { |
2658 | + extraWinInfo->state = toQtState(state); |
2659 | + } |
2660 | + |
2661 | + Q_EMIT d->m_windowModel.windowStateChanged(windowInfo, extraWinInfo->state); |
2662 | + } |
2663 | + |
2664 | + void WindowManagementPolicy::advise_move_to(const miral::WindowInfo &windowInfo, Point topLeft) |
2665 | + { |
2666 | + Q_EMIT d->m_windowModel.windowMoved(windowInfo, toQPoint(topLeft)); |
2667 | + } |
2668 | + |
2669 | + void WindowManagementPolicy::advise_resize(const miral::WindowInfo &windowInfo, const Size &newSize) |
2670 | + { |
2671 | + Q_EMIT d->m_windowModel.windowResized(windowInfo, toQSize(newSize)); |
2672 | + } |
2673 | + |
2674 | + void WindowManagementPolicy::advise_delete_window(const miral::WindowInfo &windowInfo) |
2675 | + { |
2676 | + Q_EMIT d->m_windowModel.windowRemoved(windowInfo); |
2677 | + } |
2678 | + |
2679 | + void WindowManagementPolicy::advise_raise(const std::vector<miral::Window> &windows) |
2680 | + { |
2681 | + Q_EMIT d->m_windowModel.windowsRaised(windows); |
2682 | + } |
2683 | + |
2684 | + Rectangle WindowManagementPolicy::confirm_inherited_move(miral::WindowInfo const& windowInfo, Displacement movement) |
2685 | + { |
2686 | + if (d->m_confinementRegions.isEmpty()) { |
2687 | + return CanonicalWindowManagerPolicy::confirm_inherited_move(windowInfo, movement); |
2688 | + } |
2689 | + |
2690 | + auto window = windowInfo.window(); |
2691 | + const QMargins windowMargins = d->m_windowMargins[windowInfo.type()]; |
2692 | + QRect windowGeom(toQPoint(window.top_left()), toQSize(window.size())); |
2693 | + |
2694 | + QRect geom = windowGeom.marginsAdded(windowMargins); |
2695 | + const QRect confinementRect = d->getConfinementRect(geom); |
2696 | + |
2697 | + int x = geom.x(); |
2698 | + int y = geom.y(); |
2699 | + int moveX = movement.dx.as_int(); |
2700 | + int moveY = movement.dy.as_int(); |
2701 | + |
2702 | + // If the child window is already partially beyond the available desktop area (most likely because the user |
2703 | + // explicitly moved it there) we won't pull it back, unless the inherited movement is this direction, but also won't |
2704 | + // push it even further astray. But if it currently is completely within the available desktop area boundaries |
2705 | + // we won't let go beyond it. |
2706 | + |
2707 | + if (moveX > 0) { |
2708 | + if (geom.right() < confinementRect.right()) { |
2709 | + x = qMin(x + moveX, confinementRect.right() + 1 - geom.width()); // +1 because QRect::right() weird |
2710 | + } |
2711 | + } else { |
2712 | + if (geom.x() > confinementRect.left()) { |
2713 | + x = qMax(x + moveX, confinementRect.left()); |
2714 | + } |
2715 | + } |
2716 | + |
2717 | + if (moveY > 0) { |
2718 | + if (geom.bottom() < confinementRect.bottom()) { |
2719 | + y = qMin(y + moveY, confinementRect.bottom() + 1 - geom.height()); // +1 because QRect::bottom() weird |
2720 | + } |
2721 | + } else { |
2722 | + if (geom.y() > confinementRect.top()) { |
2723 | + y = qMax(y + moveY, confinementRect.top()); |
2724 | + } |
2725 | + } |
2726 | + |
2727 | + geom.moveTo(x, y); |
2728 | + return toMirRectangle(geom.marginsRemoved(windowMargins)); |
2729 | + } |
2730 | } |
2731 | |
2732 | -using namespace qtmir; |
2733 | - |
2734 | -WindowManagementPolicy::WindowManagementPolicy(const miral::WindowManagerTools &tools, |
2735 | +WrappedWindowManagementPolicy::WrappedWindowManagementPolicy(const miral::WindowManagerTools &tools, |
2736 | qtmir::WindowModelNotifier &windowModel, |
2737 | qtmir::WindowController &windowController, |
2738 | qtmir::AppNotifier &appNotifier, |
2739 | - const QSharedPointer<ScreensModel> screensModel) |
2740 | - : CanonicalWindowManagerPolicy(tools) |
2741 | - , m_tools(tools) |
2742 | - , m_windowModel(windowModel) |
2743 | - , m_appNotifier(appNotifier) |
2744 | - , m_eventFeeder(new QtEventFeeder(screensModel)) |
2745 | + const std::shared_ptr<QtEventFeeder> &eventFeeder, |
2746 | + const qtmir::WindowManagmentPolicyBuilder &wmBuilder) |
2747 | + : qtmir::WindowManagementPolicy(tools, std::make_shared<qtmir::WindowManagementPolicyPrivate>(windowModel, |
2748 | + appNotifier, |
2749 | + eventFeeder)) |
2750 | + , m_wrapper(wmBuilder(tools, d)) |
2751 | { |
2752 | qRegisterMetaType<qtmir::NewWindow>(); |
2753 | qRegisterMetaType<std::vector<miral::Window>>(); |
2754 | @@ -53,256 +324,174 @@ |
2755 | } |
2756 | |
2757 | /* Following are hooks to allow custom policy be imposed */ |
2758 | -miral::WindowSpecification WindowManagementPolicy::place_new_window( |
2759 | +miral::WindowSpecification WrappedWindowManagementPolicy::place_new_window( |
2760 | const miral::ApplicationInfo &appInfo, |
2761 | const miral::WindowSpecification &requestParameters) |
2762 | { |
2763 | - auto parameters = CanonicalWindowManagerPolicy::place_new_window(appInfo, requestParameters); |
2764 | - |
2765 | - if (!requestParameters.parent().is_set() || requestParameters.parent().value().lock().get() == nullptr) { |
2766 | - |
2767 | - int surfaceType = requestParameters.type().is_set() ? requestParameters.type().value() : -1; |
2768 | - |
2769 | - QSize initialSize = InitialSurfaceSizes::get(miral::pid_of(appInfo.application())); |
2770 | - |
2771 | - if (initialSize.isValid() && surfaceType == mir_surface_type_normal) { |
2772 | - parameters.size() = toMirSize(initialSize); |
2773 | - } |
2774 | - } |
2775 | - |
2776 | - parameters.userdata() = std::make_shared<ExtraWindowInfo>(); |
2777 | - |
2778 | - return parameters; |
2779 | + return m_wrapper->place_new_window(appInfo, requestParameters); |
2780 | } |
2781 | |
2782 | -void WindowManagementPolicy::handle_window_ready(miral::WindowInfo &windowInfo) |
2783 | +void WrappedWindowManagementPolicy::handle_window_ready(miral::WindowInfo &windowInfo) |
2784 | { |
2785 | - CanonicalWindowManagerPolicy::handle_window_ready(windowInfo); |
2786 | - |
2787 | - Q_EMIT m_windowModel.windowReady(windowInfo); |
2788 | - |
2789 | - auto appInfo = m_tools.info_for(windowInfo.window().application()); |
2790 | - Q_EMIT m_appNotifier.appCreatedWindow(appInfo); |
2791 | + m_wrapper->handle_window_ready(windowInfo); |
2792 | } |
2793 | |
2794 | -void WindowManagementPolicy::handle_modify_window( |
2795 | +void WrappedWindowManagementPolicy::handle_modify_window( |
2796 | miral::WindowInfo &windowInfo, |
2797 | const miral::WindowSpecification &modificationsClient) |
2798 | { |
2799 | - miral::WindowSpecification modifications(modificationsClient); |
2800 | - |
2801 | - if (modifications.size().is_set()) { |
2802 | - auto extraWindowInfo = getExtraInfo(windowInfo); |
2803 | - QMutexLocker locker(&extraWindowInfo->mutex); |
2804 | - if (!extraWindowInfo->allowClientResize) { |
2805 | - modifications.size().consume(); |
2806 | - } |
2807 | - } |
2808 | - |
2809 | - CanonicalWindowManagerPolicy::handle_modify_window(windowInfo, modifications); |
2810 | - |
2811 | - // TODO Once Qt processes the request we probably don't want to notify from here |
2812 | - std::shared_ptr<mir::scene::Surface> surface{windowInfo.window()}; |
2813 | - if (SurfaceObserver *observer = SurfaceObserver::observerForSurface(surface.get())) { |
2814 | - observer->notifySurfaceModifications(modifications); |
2815 | - } |
2816 | + m_wrapper->handle_modify_window(windowInfo, modificationsClient); |
2817 | } |
2818 | |
2819 | -void WindowManagementPolicy::handle_raise_window(miral::WindowInfo &windowInfo) |
2820 | +void WrappedWindowManagementPolicy::handle_raise_window(miral::WindowInfo &windowInfo) |
2821 | { |
2822 | - Q_EMIT m_windowModel.windowRequestedRaise(windowInfo); |
2823 | + m_wrapper->handle_raise_window(windowInfo); |
2824 | } |
2825 | |
2826 | /* Handle input events - here just inject them into Qt event loop for later processing */ |
2827 | -bool WindowManagementPolicy::handle_keyboard_event(const MirKeyboardEvent *event) |
2828 | -{ |
2829 | - m_eventFeeder->dispatchKey(event); |
2830 | - return true; |
2831 | -} |
2832 | - |
2833 | -bool WindowManagementPolicy::handle_touch_event(const MirTouchEvent *event) |
2834 | -{ |
2835 | - m_eventFeeder->dispatchTouch(event); |
2836 | - return true; |
2837 | -} |
2838 | - |
2839 | -bool WindowManagementPolicy::handle_pointer_event(const MirPointerEvent *event) |
2840 | -{ |
2841 | - m_eventFeeder->dispatchPointer(event); |
2842 | - return true; |
2843 | -} |
2844 | - |
2845 | -void WindowManagementPolicy::advise_new_window(const miral::WindowInfo &windowInfo) |
2846 | -{ |
2847 | - // TODO: attach surface observer here |
2848 | - |
2849 | - getExtraInfo(windowInfo)->persistentId = QString::fromStdString(m_tools.id_for_window(windowInfo.window())); |
2850 | - |
2851 | - // FIXME: remove when possible |
2852 | - getExtraInfo(windowInfo)->state = toQtState(windowInfo.state()); |
2853 | - |
2854 | - Q_EMIT m_windowModel.windowAdded(NewWindow{windowInfo}); |
2855 | -} |
2856 | - |
2857 | -void WindowManagementPolicy::advise_delete_window(const miral::WindowInfo &windowInfo) |
2858 | -{ |
2859 | - Q_EMIT m_windowModel.windowRemoved(windowInfo); |
2860 | -} |
2861 | - |
2862 | -void WindowManagementPolicy::advise_raise(const std::vector<miral::Window> &windows) |
2863 | -{ |
2864 | - Q_EMIT m_windowModel.windowsRaised(windows); |
2865 | -} |
2866 | - |
2867 | -void WindowManagementPolicy::advise_new_app(miral::ApplicationInfo &application) |
2868 | -{ |
2869 | - tracepoint(qtmirserver, starting); |
2870 | - Q_EMIT m_appNotifier.appAdded(application); |
2871 | -} |
2872 | - |
2873 | -void WindowManagementPolicy::advise_delete_app(const miral::ApplicationInfo &application) |
2874 | -{ |
2875 | - tracepoint(qtmirserver, stopping); |
2876 | - Q_EMIT m_appNotifier.appRemoved(application); |
2877 | -} |
2878 | - |
2879 | -void WindowManagementPolicy::advise_state_change(const miral::WindowInfo &windowInfo, MirWindowState state) |
2880 | -{ |
2881 | - auto extraWinInfo = getExtraInfo(windowInfo); |
2882 | - |
2883 | - // FIXME: Remove this mess once MirWindowState matches Mir::State |
2884 | - if (state == mir_window_state_restored && extraWinInfo->state != Mir::RestoredState |
2885 | - && toMirState(extraWinInfo->state) == state) { |
2886 | - // Ignore. That MirWindowState is just a placeholder for a Mir::State value that has no counterpart |
2887 | - // in MirWindowState. |
2888 | - } else { |
2889 | - extraWinInfo->state = toQtState(state); |
2890 | - } |
2891 | - |
2892 | - Q_EMIT m_windowModel.windowStateChanged(windowInfo, extraWinInfo->state); |
2893 | -} |
2894 | - |
2895 | -void WindowManagementPolicy::advise_move_to(const miral::WindowInfo &windowInfo, Point topLeft) |
2896 | -{ |
2897 | - Q_EMIT m_windowModel.windowMoved(windowInfo, toQPoint(topLeft)); |
2898 | -} |
2899 | - |
2900 | -void WindowManagementPolicy::advise_resize(const miral::WindowInfo &windowInfo, const Size &newSize) |
2901 | -{ |
2902 | - Q_EMIT m_windowModel.windowResized(windowInfo, toQSize(newSize)); |
2903 | -} |
2904 | - |
2905 | -void WindowManagementPolicy::advise_focus_lost(const miral::WindowInfo &windowInfo) |
2906 | -{ |
2907 | - Q_EMIT m_windowModel.windowFocusChanged(windowInfo, false); |
2908 | -} |
2909 | - |
2910 | -void WindowManagementPolicy::advise_focus_gained(const miral::WindowInfo &windowInfo) |
2911 | -{ |
2912 | - // update Qt model ASAP, before applying Mir policy |
2913 | - Q_EMIT m_windowModel.windowFocusChanged(windowInfo, true); |
2914 | - |
2915 | - CanonicalWindowManagerPolicy::advise_focus_gained(windowInfo); |
2916 | -} |
2917 | - |
2918 | -void WindowManagementPolicy::advise_begin() |
2919 | -{ |
2920 | - Q_EMIT m_windowModel.modificationsStarted(); |
2921 | -} |
2922 | - |
2923 | -void WindowManagementPolicy::advise_end() |
2924 | -{ |
2925 | - Q_EMIT m_windowModel.modificationsEnded(); |
2926 | -} |
2927 | - |
2928 | -void WindowManagementPolicy::ensureWindowIsActive(const miral::Window &window) |
2929 | -{ |
2930 | - m_tools.invoke_under_lock([&window, this]() { |
2931 | - if (m_tools.active_window() != window) { |
2932 | - m_tools.select_active_window(window); |
2933 | - } |
2934 | - }); |
2935 | -} |
2936 | - |
2937 | -QRect WindowManagementPolicy::getConfinementRect(const QRect rect) const |
2938 | -{ |
2939 | - QRect confinementRect; |
2940 | - for (const QRect r : m_confinementRegions) { |
2941 | - if (r.intersects(rect)) { |
2942 | - confinementRect = r; |
2943 | - // TODO: What if there are multiple confinement regions and they intersect?? |
2944 | - break; |
2945 | - } |
2946 | - } |
2947 | - return confinementRect; |
2948 | -} |
2949 | - |
2950 | -/* Following methods all called from the Qt GUI thread to deliver events to clients */ |
2951 | -void WindowManagementPolicy::deliver_keyboard_event(const MirKeyboardEvent *event, |
2952 | - const miral::Window &window) |
2953 | +bool WrappedWindowManagementPolicy::handle_keyboard_event(const MirKeyboardEvent *event) |
2954 | +{ |
2955 | + return m_wrapper->handle_keyboard_event(event); |
2956 | +} |
2957 | + |
2958 | +bool WrappedWindowManagementPolicy::handle_touch_event(const MirTouchEvent *event) |
2959 | +{ |
2960 | + return m_wrapper->handle_touch_event(event); |
2961 | +} |
2962 | + |
2963 | +bool WrappedWindowManagementPolicy::handle_pointer_event(const MirPointerEvent *event) |
2964 | +{ |
2965 | + return m_wrapper->handle_pointer_event(event); |
2966 | +} |
2967 | + |
2968 | +void WrappedWindowManagementPolicy::advise_begin() |
2969 | +{ |
2970 | + m_wrapper->advise_begin(); |
2971 | +} |
2972 | + |
2973 | +void WrappedWindowManagementPolicy::advise_end() |
2974 | +{ |
2975 | + m_wrapper->advise_end(); |
2976 | +} |
2977 | + |
2978 | +void WrappedWindowManagementPolicy::advise_new_window(const miral::WindowInfo &windowInfo) |
2979 | +{ |
2980 | + m_wrapper->advise_new_window(windowInfo); |
2981 | +} |
2982 | + |
2983 | +void WrappedWindowManagementPolicy::advise_delete_window(const miral::WindowInfo &windowInfo) |
2984 | +{ |
2985 | + m_wrapper->advise_delete_window(windowInfo); |
2986 | +} |
2987 | + |
2988 | +void WrappedWindowManagementPolicy::advise_raise(const std::vector<miral::Window> &windows) |
2989 | +{ |
2990 | + m_wrapper->advise_raise(windows); |
2991 | +} |
2992 | + |
2993 | +Rectangle WrappedWindowManagementPolicy::confirm_inherited_move(const miral::WindowInfo &windowInfo, Displacement movement) |
2994 | +{ |
2995 | + return m_wrapper->confirm_inherited_move(windowInfo, movement); |
2996 | +} |
2997 | + |
2998 | +void WrappedWindowManagementPolicy::advise_new_app(miral::ApplicationInfo &application) |
2999 | +{ |
3000 | + m_wrapper->advise_new_app(application); |
3001 | +} |
3002 | + |
3003 | +void WrappedWindowManagementPolicy::advise_delete_app(const miral::ApplicationInfo &application) |
3004 | +{ |
3005 | + m_wrapper->advise_delete_app(application); |
3006 | +} |
3007 | + |
3008 | +void WrappedWindowManagementPolicy::advise_focus_lost(const miral::WindowInfo &info) |
3009 | +{ |
3010 | + m_wrapper->advise_focus_lost(info); |
3011 | +} |
3012 | + |
3013 | +void WrappedWindowManagementPolicy::advise_focus_gained(const miral::WindowInfo &info) |
3014 | +{ |
3015 | + m_wrapper->advise_focus_gained(info); |
3016 | +} |
3017 | + |
3018 | +void WrappedWindowManagementPolicy::advise_state_change(const miral::WindowInfo &info, MirWindowState state) |
3019 | +{ |
3020 | + m_wrapper->advise_state_change(info, state); |
3021 | +} |
3022 | + |
3023 | +void WrappedWindowManagementPolicy::advise_move_to(const miral::WindowInfo &windowInfo, Point topLeft) |
3024 | +{ |
3025 | + m_wrapper->advise_move_to(windowInfo, topLeft); |
3026 | +} |
3027 | + |
3028 | +void WrappedWindowManagementPolicy::advise_resize(const miral::WindowInfo &info, const Size &newSize) |
3029 | +{ |
3030 | + m_wrapper->advise_resize(info, newSize); |
3031 | +} |
3032 | + |
3033 | +void WrappedWindowManagementPolicy::deliver_keyboard_event(const MirKeyboardEvent *event, const miral::Window &window) |
3034 | { |
3035 | if (mir_keyboard_event_action(event) == mir_keyboard_action_down) { |
3036 | - ensureWindowIsActive(window); |
3037 | + tools.invoke_under_lock([&]() { |
3038 | + if (tools.active_window() != window) { |
3039 | + tools.select_active_window(window); |
3040 | + } |
3041 | + }); |
3042 | } |
3043 | |
3044 | - dispatchInputEvent(window, mir_keyboard_event_input_event(event)); |
3045 | + qtmir::dispatchInputEvent(window, mir_keyboard_event_input_event(event)); |
3046 | } |
3047 | |
3048 | -void WindowManagementPolicy::deliver_touch_event(const MirTouchEvent *event, |
3049 | - const miral::Window &window) |
3050 | +void WrappedWindowManagementPolicy::deliver_touch_event(const MirTouchEvent *event, const miral::Window &window) |
3051 | { |
3052 | - ensureWindowIsActive(window); |
3053 | + tools.invoke_under_lock([&]() { |
3054 | + if (tools.active_window() != window) { |
3055 | + tools.select_active_window(window); |
3056 | + } |
3057 | + }); |
3058 | |
3059 | - dispatchInputEvent(window, mir_touch_event_input_event(event)); |
3060 | + qtmir::dispatchInputEvent(window, mir_touch_event_input_event(event)); |
3061 | } |
3062 | |
3063 | -void WindowManagementPolicy::deliver_pointer_event(const MirPointerEvent *event, |
3064 | - const miral::Window &window) |
3065 | +void WrappedWindowManagementPolicy::deliver_pointer_event(const MirPointerEvent *event, const miral::Window &window) |
3066 | { |
3067 | // Prevent mouse hover events causing window focus to change |
3068 | if (mir_pointer_event_action(event) == mir_pointer_action_button_down) { |
3069 | - ensureWindowIsActive(window); |
3070 | + tools.invoke_under_lock([&]() { |
3071 | + if (tools.active_window() != window) { |
3072 | + tools.select_active_window(window); |
3073 | + } |
3074 | + }); |
3075 | } |
3076 | |
3077 | - dispatchInputEvent(window, mir_pointer_event_input_event(event)); |
3078 | + qtmir::dispatchInputEvent(window, mir_pointer_event_input_event(event)); |
3079 | } |
3080 | |
3081 | -/* Methods to allow Shell to request changes to the window stack. Called from the Qt GUI thread */ |
3082 | - |
3083 | -// raises the window tree and focus it. |
3084 | -void WindowManagementPolicy::activate(const miral::Window &window) |
3085 | +void WrappedWindowManagementPolicy::activate(const miral::Window &window) |
3086 | { |
3087 | if (window) { |
3088 | - auto &windowInfo = m_tools.info_for(window); |
3089 | + auto &windowInfo = tools.info_for(window); |
3090 | |
3091 | // restore from minimized if needed |
3092 | if (windowInfo.state() == mir_window_state_minimized) { |
3093 | - auto extraInfo = getExtraInfo(windowInfo); |
3094 | + auto extraInfo = qtmir::getExtraInfo(windowInfo); |
3095 | Q_ASSERT(extraInfo->previousState != Mir::MinimizedState); |
3096 | requestState(window, extraInfo->previousState); |
3097 | } |
3098 | } |
3099 | |
3100 | - m_tools.invoke_under_lock([&]() { |
3101 | - m_tools.select_active_window(window); |
3102 | - }); |
3103 | -} |
3104 | - |
3105 | -// raises the window tree |
3106 | -void WindowManagementPolicy::raise(const miral::Window &window) |
3107 | -{ |
3108 | - m_tools.invoke_under_lock([&window, this]() { |
3109 | - m_tools.raise_tree(window); |
3110 | - }); |
3111 | -} |
3112 | - |
3113 | -void WindowManagementPolicy::resize(const miral::Window &window, const Size size) |
3114 | + tools.invoke_under_lock([&]() { |
3115 | + tools.select_active_window(window); |
3116 | + }); |
3117 | +} |
3118 | + |
3119 | +void WrappedWindowManagementPolicy::resize(const miral::Window &window, const Size size) |
3120 | { |
3121 | miral::WindowSpecification modifications; |
3122 | modifications.size() = size; |
3123 | - m_tools.invoke_under_lock([&window, &modifications, this]() { |
3124 | + tools.invoke_under_lock([&window, &modifications, this]() { |
3125 | try { |
3126 | - m_tools.modify_window(m_tools.info_for(window), modifications); |
3127 | + tools.modify_window(tools.info_for(window), modifications); |
3128 | } catch (const std::out_of_range&) { |
3129 | // usually shell trying to operate on a window which already closed, just ignore |
3130 | // TODO: MirSurface extends the miral::Window lifetime by holding a shared pointer to |
3131 | @@ -312,13 +501,13 @@ |
3132 | }); |
3133 | } |
3134 | |
3135 | -void WindowManagementPolicy::move(const miral::Window &window, const Point topLeft) |
3136 | +void WrappedWindowManagementPolicy::move(const miral::Window &window, const Point topLeft) |
3137 | { |
3138 | miral::WindowSpecification modifications; |
3139 | modifications.top_left() = topLeft; |
3140 | - m_tools.invoke_under_lock([&window, &modifications, this]() { |
3141 | + tools.invoke_under_lock([&window, &modifications, this]() { |
3142 | try { |
3143 | - m_tools.modify_window(m_tools.info_for(window), modifications); |
3144 | + tools.modify_window(tools.info_for(window), modifications); |
3145 | } catch (const std::out_of_range&) { |
3146 | // usually shell trying to operate on a window which already closed, just ignore |
3147 | // TODO: see above comment in resize, same issue |
3148 | @@ -326,44 +515,23 @@ |
3149 | }); |
3150 | } |
3151 | |
3152 | -void WindowManagementPolicy::ask_client_to_close(const miral::Window &window) |
3153 | -{ |
3154 | - m_tools.invoke_under_lock([&window, this]() { |
3155 | - m_tools.ask_client_to_close(window); |
3156 | - }); |
3157 | -} |
3158 | - |
3159 | -void WindowManagementPolicy::forceClose(const miral::Window &window) |
3160 | -{ |
3161 | - m_tools.invoke_under_lock([&window, this]() { |
3162 | - m_tools.force_close(window); |
3163 | - }); |
3164 | -} |
3165 | - |
3166 | -void WindowManagementPolicy::set_window_confinement_regions(const QVector<QRect> ®ions) |
3167 | -{ |
3168 | - m_confinementRegions = regions; |
3169 | - |
3170 | - // TODO: update window positions to respect new boundary. |
3171 | -} |
3172 | - |
3173 | -void WindowManagementPolicy::set_window_margins(MirWindowType windowType, const QMargins &margins) |
3174 | -{ |
3175 | - m_windowMargins[windowType] = margins; |
3176 | - |
3177 | - // TODO: update window positions/sizes to respect new margins. |
3178 | -} |
3179 | - |
3180 | -void WindowManagementPolicy::requestState(const miral::Window &window, const Mir::State state) |
3181 | -{ |
3182 | - auto &windowInfo = m_tools.info_for(window); |
3183 | - auto extraWinInfo = getExtraInfo(windowInfo); |
3184 | +void WrappedWindowManagementPolicy::raise(const miral::Window &window) |
3185 | +{ |
3186 | + tools.invoke_under_lock([&window, this]() { |
3187 | + tools.raise_tree(window); |
3188 | + }); |
3189 | +} |
3190 | + |
3191 | +void WrappedWindowManagementPolicy::requestState(const miral::Window &window, const Mir::State state) |
3192 | +{ |
3193 | + auto &windowInfo = tools.info_for(window); |
3194 | + auto extraWinInfo = qtmir::getExtraInfo(windowInfo); |
3195 | |
3196 | if (extraWinInfo->state == state) |
3197 | return; |
3198 | |
3199 | miral::WindowSpecification modifications; |
3200 | - modifications.state() = toMirState(state); |
3201 | + modifications.state() = qtmir::toMirState(state); |
3202 | |
3203 | // TODO: What if the window modification fails? Is that possible? |
3204 | // Assuming here that the state will indeed change |
3205 | @@ -371,57 +539,38 @@ |
3206 | extraWinInfo->state = state; |
3207 | |
3208 | if (modifications.state() == windowInfo.state()) { |
3209 | - Q_EMIT m_windowModel.windowStateChanged(windowInfo, state); |
3210 | + Q_EMIT d->m_windowModel.windowStateChanged(windowInfo, state); |
3211 | } else { |
3212 | - m_tools.invoke_under_lock([&]() { |
3213 | - m_tools.modify_window(windowInfo, modifications); |
3214 | + tools.invoke_under_lock([&]() { |
3215 | + tools.modify_window(windowInfo, modifications); |
3216 | }); |
3217 | } |
3218 | } |
3219 | |
3220 | -Rectangle WindowManagementPolicy::confirm_inherited_move(miral::WindowInfo const& windowInfo, Displacement movement) |
3221 | -{ |
3222 | - if (m_confinementRegions.isEmpty()) { |
3223 | - return CanonicalWindowManagerPolicy::confirm_inherited_move(windowInfo, movement); |
3224 | - } |
3225 | - |
3226 | - auto window = windowInfo.window(); |
3227 | - const QMargins windowMargins = m_windowMargins[windowInfo.type()]; |
3228 | - QRect windowGeom(toQPoint(window.top_left()), toQSize(window.size())); |
3229 | - |
3230 | - QRect geom = windowGeom.marginsAdded(windowMargins); |
3231 | - const QRect confinementRect = getConfinementRect(geom); |
3232 | - |
3233 | - int x = geom.x(); |
3234 | - int y = geom.y(); |
3235 | - int moveX = movement.dx.as_int(); |
3236 | - int moveY = movement.dy.as_int(); |
3237 | - |
3238 | - // If the child window is already partially beyond the available desktop area (most likely because the user |
3239 | - // explicitly moved it there) we won't pull it back, unless the inherited movement is this direction, but also won't |
3240 | - // push it even further astray. But if it currently is completely within the available desktop area boundaries |
3241 | - // we won't let go beyond it. |
3242 | - |
3243 | - if (moveX > 0) { |
3244 | - if (geom.right() < confinementRect.right()) { |
3245 | - x = qMin(x + moveX, confinementRect.right() + 1 - geom.width()); // +1 because QRect::right() weird |
3246 | - } |
3247 | - } else { |
3248 | - if (geom.x() > confinementRect.left()) { |
3249 | - x = qMax(x + moveX, confinementRect.left()); |
3250 | - } |
3251 | - } |
3252 | - |
3253 | - if (moveY > 0) { |
3254 | - if (geom.bottom() < confinementRect.bottom()) { |
3255 | - y = qMin(y + moveY, confinementRect.bottom() + 1 - geom.height()); // +1 because QRect::bottom() weird |
3256 | - } |
3257 | - } else { |
3258 | - if (geom.y() > confinementRect.top()) { |
3259 | - y = qMax(y + moveY, confinementRect.top()); |
3260 | - } |
3261 | - } |
3262 | - |
3263 | - geom.moveTo(x, y); |
3264 | - return toMirRectangle(geom.marginsRemoved(windowMargins)); |
3265 | +void WrappedWindowManagementPolicy::ask_client_to_close(const miral::Window &window) |
3266 | +{ |
3267 | + tools.invoke_under_lock([&window, this]() { |
3268 | + tools.ask_client_to_close(window); |
3269 | + }); |
3270 | +} |
3271 | + |
3272 | +void WrappedWindowManagementPolicy::forceClose(const miral::Window &window) |
3273 | +{ |
3274 | + tools.invoke_under_lock([&window, this]() { |
3275 | + tools.force_close(window); |
3276 | + }); |
3277 | +} |
3278 | + |
3279 | +void WrappedWindowManagementPolicy::set_window_confinement_regions(const QVector<QRect> ®ions) |
3280 | +{ |
3281 | + d->m_confinementRegions = regions; |
3282 | + |
3283 | + // TODO: update window positions to respect new boundary. |
3284 | +} |
3285 | + |
3286 | +void WrappedWindowManagementPolicy::set_window_margins(MirWindowType windowType, const QMargins &margins) |
3287 | +{ |
3288 | + d->m_windowMargins[windowType] = margins; |
3289 | + |
3290 | + // TODO: update window positions/sizes to respect new margins. |
3291 | } |
3292 | |
3293 | === renamed file 'src/platforms/mirserver/windowmanagementpolicy.h' => 'src/platforms/mirserver/wrappedwindowmanagementpolicy.h' |
3294 | --- src/platforms/mirserver/windowmanagementpolicy.h 2017-03-22 14:04:23 +0000 |
3295 | +++ src/platforms/mirserver/wrappedwindowmanagementpolicy.h 2017-04-05 10:39:22 +0000 |
3296 | @@ -14,30 +14,30 @@ |
3297 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3298 | */ |
3299 | |
3300 | -#ifndef WINDOWMANAGEMENTPOLICY_H |
3301 | -#define WINDOWMANAGEMENTPOLICY_H |
3302 | - |
3303 | -#include "miral/canonical_window_manager.h" |
3304 | +#ifndef WRAPPEDWINDOWMANAGEMENTPOLICY_H |
3305 | +#define WRAPPEDWINDOWMANAGEMENTPOLICY_H |
3306 | |
3307 | #include "appnotifier.h" |
3308 | #include "qteventfeeder.h" |
3309 | #include "windowcontroller.h" |
3310 | #include "windowmodelnotifier.h" |
3311 | +#include "qtmir/windowmanagementpolicy.h" |
3312 | |
3313 | #include <QScopedPointer> |
3314 | |
3315 | using namespace mir::geometry; |
3316 | |
3317 | -class ScreensModel; |
3318 | +class QtEventFeeder; |
3319 | |
3320 | -class WindowManagementPolicy : public miral::CanonicalWindowManagerPolicy |
3321 | +class WrappedWindowManagementPolicy : public qtmir::WindowManagementPolicy |
3322 | { |
3323 | public: |
3324 | - WindowManagementPolicy(const miral::WindowManagerTools &tools, |
3325 | - qtmir::WindowModelNotifier &windowModel, |
3326 | - qtmir::WindowController &windowController, |
3327 | - qtmir::AppNotifier &appNotifier, |
3328 | - const QSharedPointer<ScreensModel> screensModel); |
3329 | + WrappedWindowManagementPolicy(const miral::WindowManagerTools &tools, |
3330 | + qtmir::WindowModelNotifier &windowModel, |
3331 | + qtmir::WindowController &windowController, |
3332 | + qtmir::AppNotifier &appNotifier, |
3333 | + const std::shared_ptr<QtEventFeeder> &eventFeeder, |
3334 | + const qtmir::WindowManagmentPolicyBuilder &wmBuilder); |
3335 | |
3336 | // From WindowManagementPolicy |
3337 | auto place_new_window(const miral::ApplicationInfo &app_info, |
3338 | @@ -71,7 +71,6 @@ |
3339 | |
3340 | Rectangle confirm_inherited_move(miral::WindowInfo const& windowInfo, Displacement movement) override; |
3341 | |
3342 | - |
3343 | // Methods for consumption by WindowControllerInterface |
3344 | void deliver_keyboard_event(const MirKeyboardEvent *event, const miral::Window &window); |
3345 | void deliver_touch_event (const MirTouchEvent *event, const miral::Window &window); |
3346 | @@ -90,15 +89,7 @@ |
3347 | void set_window_margins(MirWindowType windowType, const QMargins &margins); |
3348 | |
3349 | private: |
3350 | - void ensureWindowIsActive(const miral::Window &window); |
3351 | - QRect getConfinementRect(const QRect rect) const; |
3352 | - |
3353 | - miral::WindowManagerTools m_tools; |
3354 | - qtmir::WindowModelNotifier &m_windowModel; |
3355 | - qtmir::AppNotifier &m_appNotifier; |
3356 | - const QScopedPointer<QtEventFeeder> m_eventFeeder; |
3357 | - QVector<QRect> m_confinementRegions; |
3358 | - QMargins m_windowMargins[mir_window_types]; |
3359 | + std::shared_ptr<qtmir::WindowManagementPolicy> m_wrapper; |
3360 | }; |
3361 | |
3362 | -#endif // WINDOWMANAGEMENTPOLICY_H |
3363 | +#endif // WRAPPEDWINDOWMANAGEMENTPOLICY_H |
3364 | |
3365 | === modified file 'tests/mirserver/EventBuilder/CMakeLists.txt' |
3366 | --- tests/mirserver/EventBuilder/CMakeLists.txt 2016-10-28 10:32:49 +0000 |
3367 | +++ tests/mirserver/EventBuilder/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
3368 | @@ -17,7 +17,7 @@ |
3369 | |
3370 | target_link_libraries( |
3371 | EventBuilderTest |
3372 | - qpa-mirserver |
3373 | + qtmirserver |
3374 | ${GTEST_BOTH_LIBRARIES} |
3375 | ${GMOCK_LIBRARIES} |
3376 | ) |
3377 | |
3378 | === modified file 'tests/mirserver/QtEventFeeder/CMakeLists.txt' |
3379 | --- tests/mirserver/QtEventFeeder/CMakeLists.txt 2016-10-28 10:32:49 +0000 |
3380 | +++ tests/mirserver/QtEventFeeder/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
3381 | @@ -19,7 +19,7 @@ |
3382 | |
3383 | target_link_libraries( |
3384 | QtEventFeederTest |
3385 | - qpa-mirserver |
3386 | + qtmirserver |
3387 | ${GTEST_BOTH_LIBRARIES} |
3388 | ${GMOCK_LIBRARIES} |
3389 | ) |
3390 | |
3391 | === modified file 'tests/mirserver/Screen/CMakeLists.txt' |
3392 | --- tests/mirserver/Screen/CMakeLists.txt 2016-10-28 10:32:49 +0000 |
3393 | +++ tests/mirserver/Screen/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
3394 | @@ -20,10 +20,12 @@ |
3395 | |
3396 | target_link_libraries( |
3397 | ScreenTest |
3398 | - qpa-mirserver |
3399 | + qtmirserver |
3400 | |
3401 | ${GTEST_BOTH_LIBRARIES} |
3402 | ${GMOCK_LIBRARIES} |
3403 | + |
3404 | + Qt5::Sensors |
3405 | ) |
3406 | |
3407 | add_test(Screen, ScreenTest) |
3408 | |
3409 | === modified file 'tests/mirserver/ScreensModel/CMakeLists.txt' |
3410 | --- tests/mirserver/ScreensModel/CMakeLists.txt 2016-11-23 20:45:02 +0000 |
3411 | +++ tests/mirserver/ScreensModel/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
3412 | @@ -27,7 +27,7 @@ |
3413 | |
3414 | target_link_libraries( |
3415 | ScreensModelTest |
3416 | - qpa-mirserver |
3417 | + qtmirserver |
3418 | |
3419 | -L${CMAKE_BINARY_DIR}/tests/framework |
3420 | qtmir-test-framework-static |
3421 | |
3422 | === modified file 'tests/mirserver/miral/CMakeLists.txt' |
3423 | --- tests/mirserver/miral/CMakeLists.txt 2016-12-09 12:33:31 +0000 |
3424 | +++ tests/mirserver/miral/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
3425 | @@ -4,13 +4,13 @@ |
3426 | ) |
3427 | |
3428 | include_directories( |
3429 | - ${CMAKE_SOURCE_DIR}/src/platforms/mirserver/miral |
3430 | + ${CMAKE_SOURCE_DIR}/include |
3431 | ) |
3432 | |
3433 | add_executable(MirALTests ${MIRAL_TEST_SOURCES}) |
3434 | |
3435 | target_link_libraries(MirALTests |
3436 | - qpa-mirserver |
3437 | + qtmirserver |
3438 | ${GTEST_BOTH_LIBRARIES} |
3439 | ${GMOCK_LIBRARIES} |
3440 | ) |
3441 | |
3442 | === modified file 'tests/mirserver/miral/edid_test.cpp' |
3443 | --- tests/mirserver/miral/edid_test.cpp 2017-01-27 08:56:34 +0000 |
3444 | +++ tests/mirserver/miral/edid_test.cpp 2017-04-05 10:39:22 +0000 |
3445 | @@ -18,7 +18,7 @@ |
3446 | #include <gtest/gtest.h> |
3447 | #include <numeric> |
3448 | |
3449 | -#include "edid.h" |
3450 | +#include "qtmir/miral/edid.h" |
3451 | |
3452 | using namespace miral; |
3453 | |
3454 | |
3455 | === modified file 'tests/modules/Application/CMakeLists.txt' |
3456 | --- tests/modules/Application/CMakeLists.txt 2016-11-03 20:17:46 +0000 |
3457 | +++ tests/modules/Application/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
3458 | @@ -14,7 +14,7 @@ |
3459 | ${MIRAL_INCLUDE_DIRS} |
3460 | ${MIRSERVER_INCLUDE_DIRS} |
3461 | ${Qt5Core_INCLUDE_DIRS} |
3462 | - ${Qt5GUI_INCLUDE_DIRS} |
3463 | + ${Qt5Gui_INCLUDE_DIRS} |
3464 | ${Qt5Quick_INCLUDE_DIRS} |
3465 | ${Qt5DBus_INCLUDE_DIRS} |
3466 | ) |
3467 | |
3468 | === modified file 'tests/modules/WindowManager/CMakeLists.txt' |
3469 | --- tests/modules/WindowManager/CMakeLists.txt 2016-11-03 20:17:46 +0000 |
3470 | +++ tests/modules/WindowManager/CMakeLists.txt 2017-04-05 10:39:22 +0000 |
3471 | @@ -7,6 +7,7 @@ |
3472 | ) |
3473 | |
3474 | include_directories( |
3475 | + ${CMAKE_SOURCE_DIR}/include |
3476 | ${CMAKE_SOURCE_DIR}/src/common |
3477 | ${CMAKE_SOURCE_DIR}/src/modules |
3478 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
FAILED: Continuous integration, rev:624 /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/499/ /unity8- jenkins. ubuntu. com/job/ build/4096/ console /unity8- jenkins. ubuntu. com/job/ build-0- fetch/4124 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 3964 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 3964/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/3964 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/3964/ artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 3964 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 3964/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/3964/ console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 3964 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 3964/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/3964/ console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/499/ rebuild
https:/