Merge lp:~alan-griffiths/qtmir/spike-using-WindowManager into lp:qtmir/devel-mir-next
- spike-using-WindowManager
- Merge into devel-mir-next
Status: | Work in progress |
---|---|
Proposed branch: | lp:~alan-griffiths/qtmir/spike-using-WindowManager |
Merge into: | lp:qtmir/devel-mir-next |
Prerequisite: | lp:~mir-team/qtmir/devel-mir-next-update |
Diff against target: |
777 lines (+201/-238) 14 files modified
src/modules/Unity/Application/application_manager.h (+1/-1) src/modules/Unity/Application/mirsurfaceitem.cpp (+2/-2) src/modules/Unity/Application/mirsurfaceitem.h (+4/-3) src/modules/Unity/Application/mirsurfacemanager.cpp (+8/-9) src/modules/Unity/Application/mirsurfacemanager.h (+5/-5) src/modules/Unity/Application/sessionmanager.cpp (+0/-1) src/platforms/mirserver/CMakeLists.txt (+1/-1) src/platforms/mirserver/mirserver.cpp (+32/-50) src/platforms/mirserver/mirserver.h (+8/-7) src/platforms/mirserver/mirwindowmanager.cpp (+98/-140) src/platforms/mirserver/mirwindowmanager.h (+33/-14) src/platforms/mirserver/nativeinterface.cpp (+7/-2) src/platforms/mirserver/nativeinterface.h (+1/-1) tests/modules/common/qtmir_test.h (+1/-2) |
To merge this branch: | bzr merge lp:~alan-griffiths/qtmir/spike-using-WindowManager |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Pending | |
Mir development team | Pending | ||
Review via email: mp+254907@code.launchpad.net |
This proposal supersedes a proposal from 2015-03-26.
Commit message
Switch from subclassing mir::shell:
Description of the change
Switch from subclassing mir::shell:
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
- 278. By Daniel van Vugt
- 279. By Alan Griffiths
-
Mir 0.13.0 fixes
- 280. By Alan Griffiths
-
Workaround API that uses references to opaque types
- 281. By Alan Griffiths
-
libmircommon-dev dependency should be versioned
- 282. By Alan Griffiths
- 283. By Alan Griffiths
-
Very basic version of MirWindowManage
r::modify_ surface( )
Alan Griffiths (alan-griffiths) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
Works on manta with Mir 0.13.0 stack
* Did CI run pass?
Not until 0.13.0 is in archive
Unmerged revisions
- 283. By Alan Griffiths
-
Very basic version of MirWindowManage
r::modify_ surface( ) - 282. By Alan Griffiths
- 281. By Alan Griffiths
-
libmircommon-dev dependency should be versioned
- 280. By Alan Griffiths
-
Workaround API that uses references to opaque types
- 279. By Alan Griffiths
-
Mir 0.13.0 fixes
- 278. By Daniel van Vugt
- 277. By Daniel van Vugt
-
Update mock headers so they can build again, following racarr's
cursor BufferStream changes. - 276. By Daniel van Vugt
-
Migrate to MirEvent 2.1 API, coming in Mir 0.13
- 275. By Daniel van Vugt
-
Link to libmirclient too. That's where all mir_* client (and input
functions) now correctly reside. - 274. By Daniel van Vugt
-
Merge branch lp:~mir-team/qtmir/compatibility-with-mir-API-changes
Preview Diff
1 | === modified file 'src/modules/Unity/Application/application_manager.h' | |||
2 | --- src/modules/Unity/Application/application_manager.h 2015-01-09 11:23:34 +0000 | |||
3 | +++ src/modules/Unity/Application/application_manager.h 2015-05-06 15:47:57 +0000 | |||
4 | @@ -151,7 +151,7 @@ | |||
5 | 151 | 151 | ||
6 | 152 | Application* findApplicationWithPromptSession(const mir::scene::PromptSession* promptSession); | 152 | Application* findApplicationWithPromptSession(const mir::scene::PromptSession* promptSession); |
7 | 153 | 153 | ||
9 | 154 | QSharedPointer<MirServer> m_mirServer; | 154 | const QSharedPointer<MirServer> m_mirServer; |
10 | 155 | 155 | ||
11 | 156 | QList<Application*> m_applications; | 156 | QList<Application*> m_applications; |
12 | 157 | Application* m_focusedApplication; | 157 | Application* m_focusedApplication; |
13 | 158 | 158 | ||
14 | === modified file 'src/modules/Unity/Application/mirsurfaceitem.cpp' | |||
15 | --- src/modules/Unity/Application/mirsurfaceitem.cpp 2015-03-27 07:29:14 +0000 | |||
16 | +++ src/modules/Unity/Application/mirsurfaceitem.cpp 2015-05-06 15:47:57 +0000 | |||
17 | @@ -23,7 +23,6 @@ | |||
18 | 23 | #include "mirbuffersgtexture.h" | 23 | #include "mirbuffersgtexture.h" |
19 | 24 | #include "session.h" | 24 | #include "session.h" |
20 | 25 | #include "mirsurfaceitem.h" | 25 | #include "mirsurfaceitem.h" |
21 | 26 | #include "mirshell.h" | ||
22 | 27 | #include "logging.h" | 26 | #include "logging.h" |
23 | 28 | #include "ubuntukeyboardinfo.h" | 27 | #include "ubuntukeyboardinfo.h" |
24 | 29 | 28 | ||
25 | @@ -46,6 +45,7 @@ | |||
26 | 46 | // Mir | 45 | // Mir |
27 | 47 | #include <mir/geometry/rectangle.h> | 46 | #include <mir/geometry/rectangle.h> |
28 | 48 | #include <mir/events/event_builders.h> | 47 | #include <mir/events/event_builders.h> |
29 | 48 | #include <mir/shell/shell.h> | ||
30 | 49 | #include <mir_toolkit/event.h> | 49 | #include <mir_toolkit/event.h> |
31 | 50 | 50 | ||
32 | 51 | namespace mg = mir::graphics; | 51 | namespace mg = mir::graphics; |
33 | @@ -187,7 +187,7 @@ | |||
34 | 187 | 187 | ||
35 | 188 | MirSurfaceItem::MirSurfaceItem(std::shared_ptr<mir::scene::Surface> surface, | 188 | MirSurfaceItem::MirSurfaceItem(std::shared_ptr<mir::scene::Surface> surface, |
36 | 189 | SessionInterface* session, | 189 | SessionInterface* session, |
38 | 190 | MirShell *shell, | 190 | mir::shell::Shell *shell, |
39 | 191 | std::shared_ptr<SurfaceObserver> observer, | 191 | std::shared_ptr<SurfaceObserver> observer, |
40 | 192 | QQuickItem *parent) | 192 | QQuickItem *parent) |
41 | 193 | : QQuickItem(parent) | 193 | : QQuickItem(parent) |
42 | 194 | 194 | ||
43 | === modified file 'src/modules/Unity/Application/mirsurfaceitem.h' | |||
44 | --- src/modules/Unity/Application/mirsurfaceitem.h 2015-02-20 15:52:17 +0000 | |||
45 | +++ src/modules/Unity/Application/mirsurfaceitem.h 2015-05-06 15:47:57 +0000 | |||
46 | @@ -33,8 +33,9 @@ | |||
47 | 33 | 33 | ||
48 | 34 | #include "session_interface.h" | 34 | #include "session_interface.h" |
49 | 35 | 35 | ||
50 | 36 | namespace mir { namespace shell { class Shell; } } | ||
51 | 37 | |||
52 | 36 | class SurfaceObserver; | 38 | class SurfaceObserver; |
53 | 37 | class MirShell; | ||
54 | 38 | 39 | ||
55 | 39 | namespace qtmir { | 40 | namespace qtmir { |
56 | 40 | 41 | ||
57 | @@ -58,7 +59,7 @@ | |||
58 | 58 | public: | 59 | public: |
59 | 59 | explicit MirSurfaceItem(std::shared_ptr<mir::scene::Surface> surface, | 60 | explicit MirSurfaceItem(std::shared_ptr<mir::scene::Surface> surface, |
60 | 60 | SessionInterface* session, | 61 | SessionInterface* session, |
62 | 61 | MirShell *shell, | 62 | mir::shell::Shell *shell, |
63 | 62 | std::shared_ptr<SurfaceObserver> observer, | 63 | std::shared_ptr<SurfaceObserver> observer, |
64 | 63 | QQuickItem *parent = 0); | 64 | QQuickItem *parent = 0); |
65 | 64 | ~MirSurfaceItem(); | 65 | ~MirSurfaceItem(); |
66 | @@ -179,7 +180,7 @@ | |||
67 | 179 | 180 | ||
68 | 180 | std::shared_ptr<mir::scene::Surface> m_surface; | 181 | std::shared_ptr<mir::scene::Surface> m_surface; |
69 | 181 | QPointer<SessionInterface> m_session; | 182 | QPointer<SessionInterface> m_session; |
71 | 182 | MirShell *const m_shell; | 183 | mir::shell::Shell *const m_shell; |
72 | 183 | bool m_firstFrameDrawn; | 184 | bool m_firstFrameDrawn; |
73 | 184 | bool m_live; | 185 | bool m_live; |
74 | 185 | Qt::ScreenOrientation m_orientation; //FIXME - have to save the state as Mir has no getter for it (bug:1357429) | 186 | Qt::ScreenOrientation m_orientation; //FIXME - have to save the state as Mir has no getter for it (bug:1357429) |
75 | 186 | 187 | ||
76 | === modified file 'src/modules/Unity/Application/mirsurfacemanager.cpp' | |||
77 | --- src/modules/Unity/Application/mirsurfacemanager.cpp 2015-02-06 09:47:21 +0000 | |||
78 | +++ src/modules/Unity/Application/mirsurfacemanager.cpp 2015-05-06 15:47:57 +0000 | |||
79 | @@ -31,7 +31,7 @@ | |||
80 | 31 | #include "nativeinterface.h" | 31 | #include "nativeinterface.h" |
81 | 32 | #include "mirserver.h" | 32 | #include "mirserver.h" |
82 | 33 | #include "sessionlistener.h" | 33 | #include "sessionlistener.h" |
84 | 34 | #include "mirshell.h" | 34 | #include "mirwindowmanager.h" |
85 | 35 | #include "logging.h" | 35 | #include "logging.h" |
86 | 36 | 36 | ||
87 | 37 | Q_LOGGING_CATEGORY(QTMIR_SURFACES, "qtmir.surfaces") | 37 | Q_LOGGING_CATEGORY(QTMIR_SURFACES, "qtmir.surfaces") |
88 | @@ -51,9 +51,9 @@ | |||
89 | 51 | manager, &MirSurfaceManager::onSessionDestroyingSurface); | 51 | manager, &MirSurfaceManager::onSessionDestroyingSurface); |
90 | 52 | } | 52 | } |
91 | 53 | 53 | ||
93 | 54 | void connectToShell(MirSurfaceManager *manager, MirShell *shell) | 54 | void connectToWindowManager(MirSurfaceManager *manager, MirWindowManager *windowManager) |
94 | 55 | { | 55 | { |
96 | 56 | QObject::connect(shell, &MirShell::surfaceAttributeChanged, | 56 | QObject::connect(windowManager, &MirWindowManager::surfaceAttributeChanged, |
97 | 57 | manager, &MirSurfaceManager::onSurfaceAttributeChanged); | 57 | manager, &MirSurfaceManager::onSurfaceAttributeChanged); |
98 | 58 | } | 58 | } |
99 | 59 | 59 | ||
100 | @@ -70,23 +70,22 @@ | |||
101 | 70 | } | 70 | } |
102 | 71 | 71 | ||
103 | 72 | SessionListener *sessionListener = static_cast<SessionListener*>(nativeInterface->nativeResourceForIntegration("SessionListener")); | 72 | SessionListener *sessionListener = static_cast<SessionListener*>(nativeInterface->nativeResourceForIntegration("SessionListener")); |
105 | 73 | MirShell *shell = static_cast<MirShell*>(nativeInterface->nativeResourceForIntegration("Shell")); | 73 | MirWindowManager *window_manager = static_cast<MirWindowManager*>(nativeInterface->nativeResourceForIntegration("WindowManager")); |
106 | 74 | mir::shell::Shell *const shell = static_cast<mir::shell::Shell*>(nativeInterface->nativeResourceForIntegration("mir::shell::Shell")); | ||
107 | 74 | 75 | ||
109 | 75 | the_surface_manager = new MirSurfaceManager(nativeInterface->m_mirServer, shell, SessionManager::singleton()); | 76 | the_surface_manager = new MirSurfaceManager(shell, SessionManager::singleton()); |
110 | 76 | 77 | ||
111 | 77 | connectToSessionListener(the_surface_manager, sessionListener); | 78 | connectToSessionListener(the_surface_manager, sessionListener); |
113 | 78 | connectToShell(the_surface_manager, shell); | 79 | connectToWindowManager(the_surface_manager, window_manager); |
114 | 79 | } | 80 | } |
115 | 80 | return the_surface_manager; | 81 | return the_surface_manager; |
116 | 81 | } | 82 | } |
117 | 82 | 83 | ||
118 | 83 | MirSurfaceManager::MirSurfaceManager( | 84 | MirSurfaceManager::MirSurfaceManager( |
121 | 84 | const QSharedPointer<MirServer>& mirServer, | 85 | mir::shell::Shell *shell, |
120 | 85 | MirShell *shell, | ||
122 | 86 | SessionManager* sessionManager, | 86 | SessionManager* sessionManager, |
123 | 87 | QObject *parent) | 87 | QObject *parent) |
124 | 88 | : MirSurfaceItemModel(parent) | 88 | : MirSurfaceItemModel(parent) |
125 | 89 | , m_mirServer(mirServer) | ||
126 | 90 | , m_shell(shell) | 89 | , m_shell(shell) |
127 | 91 | , m_sessionManager(sessionManager) | 90 | , m_sessionManager(sessionManager) |
128 | 92 | { | 91 | { |
129 | 93 | 92 | ||
130 | === modified file 'src/modules/Unity/Application/mirsurfacemanager.h' | |||
131 | --- src/modules/Unity/Application/mirsurfacemanager.h 2015-02-06 09:47:21 +0000 | |||
132 | +++ src/modules/Unity/Application/mirsurfacemanager.h 2015-05-06 15:47:57 +0000 | |||
133 | @@ -37,10 +37,12 @@ | |||
134 | 37 | class Session; | 37 | class Session; |
135 | 38 | class PromptSession; | 38 | class PromptSession; |
136 | 39 | } | 39 | } |
137 | 40 | namespace shell { | ||
138 | 41 | class Shell; | ||
139 | 42 | } | ||
140 | 40 | } | 43 | } |
141 | 41 | 44 | ||
142 | 42 | class MirServer; | 45 | class MirServer; |
143 | 43 | class MirShell; | ||
144 | 44 | 46 | ||
145 | 45 | namespace qtmir { | 47 | namespace qtmir { |
146 | 46 | 48 | ||
147 | @@ -54,8 +56,7 @@ | |||
148 | 54 | 56 | ||
149 | 55 | public: | 57 | public: |
150 | 56 | explicit MirSurfaceManager( | 58 | explicit MirSurfaceManager( |
153 | 57 | const QSharedPointer<MirServer>& mirServer, | 59 | mir::shell::Shell *shell, |
152 | 58 | MirShell *shell, | ||
154 | 59 | SessionManager* sessionManager, | 60 | SessionManager* sessionManager, |
155 | 60 | QObject *parent = 0 | 61 | QObject *parent = 0 |
156 | 61 | ); | 62 | ); |
157 | @@ -81,8 +82,7 @@ | |||
158 | 81 | QMutex m_mutex; | 82 | QMutex m_mutex; |
159 | 82 | 83 | ||
160 | 83 | private: | 84 | private: |
163 | 84 | QSharedPointer<MirServer> m_mirServer; | 85 | mir::shell::Shell *const m_shell; |
162 | 85 | MirShell *const m_shell; | ||
164 | 86 | SessionManager* m_sessionManager; | 86 | SessionManager* m_sessionManager; |
165 | 87 | static MirSurfaceManager *the_surface_manager; | 87 | static MirSurfaceManager *the_surface_manager; |
166 | 88 | }; | 88 | }; |
167 | 89 | 89 | ||
168 | === modified file 'src/modules/Unity/Application/sessionmanager.cpp' | |||
169 | --- src/modules/Unity/Application/sessionmanager.cpp 2015-01-28 14:25:36 +0000 | |||
170 | +++ src/modules/Unity/Application/sessionmanager.cpp 2015-05-06 15:47:57 +0000 | |||
171 | @@ -26,7 +26,6 @@ | |||
172 | 26 | #include "nativeinterface.h" | 26 | #include "nativeinterface.h" |
173 | 27 | #include "mirserver.h" | 27 | #include "mirserver.h" |
174 | 28 | #include "sessionlistener.h" | 28 | #include "sessionlistener.h" |
175 | 29 | #include "mirshell.h" | ||
176 | 30 | #include "logging.h" | 29 | #include "logging.h" |
177 | 31 | #include "promptsessionlistener.h" | 30 | #include "promptsessionlistener.h" |
178 | 32 | 31 | ||
179 | 33 | 32 | ||
180 | === modified file 'src/platforms/mirserver/CMakeLists.txt' | |||
181 | --- src/platforms/mirserver/CMakeLists.txt 2015-04-01 11:59:05 +0000 | |||
182 | +++ src/platforms/mirserver/CMakeLists.txt 2015-05-06 15:47:57 +0000 | |||
183 | @@ -37,7 +37,7 @@ | |||
184 | 37 | 37 | ||
185 | 38 | set(MIRSERVER_QPA_PLUGIN_SRC | 38 | set(MIRSERVER_QPA_PLUGIN_SRC |
186 | 39 | ../../common/debughelpers.cpp | 39 | ../../common/debughelpers.cpp |
188 | 40 | mirshell.cpp | 40 | mirwindowmanager.cpp |
189 | 41 | qteventfeeder.cpp | 41 | qteventfeeder.cpp |
190 | 42 | plugin.cpp | 42 | plugin.cpp |
191 | 43 | qmirserver.cpp | 43 | qmirserver.cpp |
192 | 44 | 44 | ||
193 | === modified file 'src/platforms/mirserver/mirserver.cpp' | |||
194 | --- src/platforms/mirserver/mirserver.cpp 2015-02-09 16:28:40 +0000 | |||
195 | +++ src/platforms/mirserver/mirserver.cpp 2015-05-06 15:47:57 +0000 | |||
196 | @@ -1,5 +1,5 @@ | |||
197 | 1 | /* | 1 | /* |
199 | 2 | * Copyright (C) 2013-2014 Canonical, Ltd. | 2 | * Copyright (C) 2013-2015 Canonical, Ltd. |
200 | 3 | * | 3 | * |
201 | 4 | * This program is free software: you can redistribute it and/or modify it under | 4 | * This program is free software: you can redistribute it and/or modify it under |
202 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | 5 | * the terms of the GNU Lesser General Public License version 3, as published by |
203 | @@ -19,7 +19,7 @@ | |||
204 | 19 | #include "mirserver.h" | 19 | #include "mirserver.h" |
205 | 20 | 20 | ||
206 | 21 | // local | 21 | // local |
208 | 22 | #include "mirshell.h" | 22 | #include "mirwindowmanager.h" |
209 | 23 | #include "mirglconfig.h" | 23 | #include "mirglconfig.h" |
210 | 24 | #include "mirserverstatuslistener.h" | 24 | #include "mirserverstatuslistener.h" |
211 | 25 | #include "promptsessionlistener.h" | 25 | #include "promptsessionlistener.h" |
212 | @@ -51,19 +51,25 @@ | |||
213 | 51 | set_command_line_handler(&ignore_unparsed_arguments); | 51 | set_command_line_handler(&ignore_unparsed_arguments); |
214 | 52 | set_command_line(argc, argv); | 52 | set_command_line(argc, argv); |
215 | 53 | 53 | ||
229 | 54 | override_the_session_listener([] | 54 | override_the_session_listener([this] |
230 | 55 | { | 55 | { |
231 | 56 | return std::make_shared<SessionListener>(); | 56 | const auto result = std::make_shared<SessionListener>(); |
232 | 57 | }); | 57 | m_sessionListener = result; |
233 | 58 | 58 | return result; | |
234 | 59 | override_the_prompt_session_listener([] | 59 | }); |
235 | 60 | { | 60 | |
236 | 61 | return std::make_shared<PromptSessionListener>(); | 61 | override_the_prompt_session_listener([this] |
237 | 62 | }); | 62 | { |
238 | 63 | 63 | const auto result = std::make_shared<PromptSessionListener>(); | |
239 | 64 | override_the_session_authorizer([] | 64 | m_promptSessionListener = result; |
240 | 65 | { | 65 | return result; |
241 | 66 | return std::make_shared<SessionAuthorizer>(); | 66 | }); |
242 | 67 | |||
243 | 68 | override_the_session_authorizer([this] | ||
244 | 69 | { | ||
245 | 70 | const auto result = std::make_shared<SessionAuthorizer>(); | ||
246 | 71 | m_sessionAuthorizer = result; | ||
247 | 72 | return result; | ||
248 | 67 | }); | 73 | }); |
249 | 68 | 74 | ||
250 | 69 | override_the_compositor([] | 75 | override_the_compositor([] |
251 | @@ -86,17 +92,11 @@ | |||
252 | 86 | return std::make_shared<MirServerStatusListener>(); | 92 | return std::make_shared<MirServerStatusListener>(); |
253 | 87 | }); | 93 | }); |
254 | 88 | 94 | ||
256 | 89 | override_the_shell([this] | 95 | override_the_window_manager_builder([this](mir::shell::FocusController*) |
257 | 90 | { | 96 | { |
267 | 91 | auto const shell = std::make_shared<MirShell>( | 97 | const auto result = std::make_shared<MirWindowManager>(the_shell_display_layout()); |
268 | 92 | the_input_targeter(), | 98 | m_windowManager = result; |
269 | 93 | the_surface_coordinator(), | 99 | return result; |
261 | 94 | the_session_coordinator(), | ||
262 | 95 | the_prompt_session_manager(), | ||
263 | 96 | the_shell_display_layout()); | ||
264 | 97 | |||
265 | 98 | m_shell = shell; | ||
266 | 99 | return shell; | ||
270 | 100 | }); | 100 | }); |
271 | 101 | 101 | ||
272 | 102 | set_terminator([&](int) | 102 | set_terminator([&](int) |
273 | @@ -113,43 +113,25 @@ | |||
274 | 113 | 113 | ||
275 | 114 | /************************************ Shell side ************************************/ | 114 | /************************************ Shell side ************************************/ |
276 | 115 | 115 | ||
288 | 116 | // | 116 | // Note about the"weak_ptr<X>.lock().get();" constructs used in the functions below. |
289 | 117 | // Note about the | 117 | // An empty weak_ptr<> means that Mir is not holding the pointer so we return nullptr. |
279 | 118 | // if (sharedPtr.unique()) return 0; | ||
280 | 119 | // constructs used in the functions below. | ||
281 | 120 | // The rationale is that if when you do | ||
282 | 121 | // the_session_authorizer() | ||
283 | 122 | // get a pointer that is unique means that Mir is not | ||
284 | 123 | // holding the pointer and thus when we return from the | ||
285 | 124 | // sessionAuthorizer() | ||
286 | 125 | // scope the unique pointer will be destroyed so we return 0 | ||
287 | 126 | // | ||
290 | 127 | 118 | ||
291 | 128 | SessionAuthorizer *MirServer::sessionAuthorizer() | 119 | SessionAuthorizer *MirServer::sessionAuthorizer() |
292 | 129 | { | 120 | { |
297 | 130 | auto sharedPtr = the_session_authorizer(); | 121 | return m_sessionAuthorizer.lock().get(); |
294 | 131 | if (sharedPtr.unique()) return 0; | ||
295 | 132 | |||
296 | 133 | return static_cast<SessionAuthorizer*>(sharedPtr.get()); | ||
298 | 134 | } | 122 | } |
299 | 135 | 123 | ||
300 | 136 | SessionListener *MirServer::sessionListener() | 124 | SessionListener *MirServer::sessionListener() |
301 | 137 | { | 125 | { |
306 | 138 | auto sharedPtr = the_session_listener(); | 126 | return m_sessionListener.lock().get(); |
303 | 139 | if (sharedPtr.unique()) return 0; | ||
304 | 140 | |||
305 | 141 | return static_cast<SessionListener*>(sharedPtr.get()); | ||
307 | 142 | } | 127 | } |
308 | 143 | 128 | ||
309 | 144 | PromptSessionListener *MirServer::promptSessionListener() | 129 | PromptSessionListener *MirServer::promptSessionListener() |
310 | 145 | { | 130 | { |
315 | 146 | auto sharedPtr = the_prompt_session_listener(); | 131 | return m_promptSessionListener.lock().get(); |
312 | 147 | if (sharedPtr.unique()) return 0; | ||
313 | 148 | |||
314 | 149 | return static_cast<PromptSessionListener*>(sharedPtr.get()); | ||
316 | 150 | } | 132 | } |
317 | 151 | 133 | ||
319 | 152 | MirShell *MirServer::shell() | 134 | MirWindowManager *MirServer::windowManager() |
320 | 153 | { | 135 | { |
322 | 154 | return m_shell.lock().get(); | 136 | return m_windowManager.lock().get(); |
323 | 155 | } | 137 | } |
324 | 156 | 138 | ||
325 | === modified file 'src/platforms/mirserver/mirserver.h' | |||
326 | --- src/platforms/mirserver/mirserver.h 2015-03-25 14:49:58 +0000 | |||
327 | +++ src/platforms/mirserver/mirserver.h 2015-05-06 15:47:57 +0000 | |||
328 | @@ -23,7 +23,7 @@ | |||
329 | 23 | class QtEventFeeder; | 23 | class QtEventFeeder; |
330 | 24 | class SessionListener; | 24 | class SessionListener; |
331 | 25 | class SessionAuthorizer; | 25 | class SessionAuthorizer; |
333 | 26 | class MirShell; | 26 | class MirWindowManager; |
334 | 27 | class PromptSessionListener; | 27 | class PromptSessionListener; |
335 | 28 | 28 | ||
336 | 29 | // We use virtual inheritance of mir::Server to facilitate derived classes (e.g. testing) | 29 | // We use virtual inheritance of mir::Server to facilitate derived classes (e.g. testing) |
337 | @@ -34,7 +34,7 @@ | |||
338 | 34 | 34 | ||
339 | 35 | Q_PROPERTY(SessionAuthorizer* sessionAuthorizer READ sessionAuthorizer CONSTANT) | 35 | Q_PROPERTY(SessionAuthorizer* sessionAuthorizer READ sessionAuthorizer CONSTANT) |
340 | 36 | Q_PROPERTY(SessionListener* sessionListener READ sessionListener CONSTANT) | 36 | Q_PROPERTY(SessionListener* sessionListener READ sessionListener CONSTANT) |
342 | 37 | Q_PROPERTY(MirShell* shell READ shell CONSTANT) | 37 | Q_PROPERTY(MirWindowManager* windowManager READ windowManager CONSTANT) |
343 | 38 | Q_PROPERTY(PromptSessionListener* promptSessionListener READ promptSessionListener CONSTANT) | 38 | Q_PROPERTY(PromptSessionListener* promptSessionListener READ promptSessionListener CONSTANT) |
344 | 39 | 39 | ||
345 | 40 | public: | 40 | public: |
346 | @@ -47,21 +47,22 @@ | |||
347 | 47 | using mir::Server::the_display; | 47 | using mir::Server::the_display; |
348 | 48 | using mir::Server::the_gl_config; | 48 | using mir::Server::the_gl_config; |
349 | 49 | using mir::Server::the_main_loop; | 49 | using mir::Server::the_main_loop; |
350 | 50 | using mir::Server::the_prompt_session_listener; | ||
351 | 51 | using mir::Server::the_prompt_session_manager; | 50 | using mir::Server::the_prompt_session_manager; |
354 | 52 | using mir::Server::the_session_authorizer; | 51 | using mir::Server::the_shell; |
353 | 53 | using mir::Server::the_session_listener; | ||
355 | 54 | 52 | ||
356 | 55 | /* qt specific */ | 53 | /* qt specific */ |
357 | 56 | // getters | 54 | // getters |
358 | 57 | SessionAuthorizer *sessionAuthorizer(); | 55 | SessionAuthorizer *sessionAuthorizer(); |
359 | 58 | SessionListener *sessionListener(); | 56 | SessionListener *sessionListener(); |
360 | 59 | PromptSessionListener *promptSessionListener(); | 57 | PromptSessionListener *promptSessionListener(); |
362 | 60 | MirShell *shell(); | 58 | MirWindowManager *windowManager(); |
363 | 61 | 59 | ||
364 | 62 | private: | 60 | private: |
365 | 63 | std::shared_ptr<QtEventFeeder> m_qtEventFeeder; | 61 | std::shared_ptr<QtEventFeeder> m_qtEventFeeder; |
367 | 64 | std::weak_ptr<MirShell> m_shell; | 62 | std::weak_ptr<SessionAuthorizer> m_sessionAuthorizer; |
368 | 63 | std::weak_ptr<SessionListener> m_sessionListener; | ||
369 | 64 | std::weak_ptr<PromptSessionListener> m_promptSessionListener; | ||
370 | 65 | std::weak_ptr<MirWindowManager> m_windowManager; | ||
371 | 65 | }; | 66 | }; |
372 | 66 | 67 | ||
373 | 67 | #endif // MIRSERVER_H | 68 | #endif // MIRSERVER_H |
374 | 68 | 69 | ||
375 | === renamed file 'src/platforms/mirserver/mirshell.cpp' => 'src/platforms/mirserver/mirwindowmanager.cpp' | |||
376 | --- src/platforms/mirserver/mirshell.cpp 2015-05-01 13:21:00 +0000 | |||
377 | +++ src/platforms/mirserver/mirwindowmanager.cpp 2015-05-06 15:47:57 +0000 | |||
378 | @@ -14,163 +14,121 @@ | |||
379 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
380 | 15 | */ | 15 | */ |
381 | 16 | 16 | ||
383 | 17 | #include "mirshell.h" | 17 | #include "mirwindowmanager.h" |
384 | 18 | #include "logging.h" | 18 | #include "logging.h" |
385 | 19 | #include "tracepoints.h" // generated from tracepoints.tp | 19 | #include "tracepoints.h" // generated from tracepoints.tp |
386 | 20 | 20 | ||
387 | 21 | #include <mir/geometry/rectangle.h> | 21 | #include <mir/geometry/rectangle.h> |
388 | 22 | #include <mir/scene/session.h> | 22 | #include <mir/scene/session.h> |
389 | 23 | #include <mir/scene/surface.h> | ||
390 | 23 | #include <mir/scene/surface_creation_parameters.h> | 24 | #include <mir/scene/surface_creation_parameters.h> |
391 | 24 | #include <mir/scene/surface.h> | ||
392 | 25 | #include <mir/shell/display_layout.h> | 25 | #include <mir/shell/display_layout.h> |
393 | 26 | #include <mir/shell/window_manager.h> | ||
394 | 27 | 26 | ||
395 | 28 | namespace ms = mir::scene; | 27 | namespace ms = mir::scene; |
451 | 29 | using mir::shell::AbstractShell; | 28 | |
452 | 30 | 29 | MirWindowManager::MirWindowManager(const std::shared_ptr<mir::shell::DisplayLayout> &displayLayout) : | |
453 | 31 | namespace | 30 | m_displayLayout{displayLayout} |
454 | 32 | { | 31 | { |
455 | 33 | class NullWindowManager : public mir::shell::WindowManager | 32 | qCDebug(QTMIR_MIR_MESSAGES) << "MirWindowManager::MirWindowManager"; |
456 | 34 | { | 33 | } |
457 | 35 | public: | 34 | |
458 | 36 | void add_session(std::shared_ptr<ms::Session> const& session) override; | 35 | auto MirWindowManager::add_surface( |
459 | 37 | 36 | std::shared_ptr<mir::scene::Session> const& session, | |
460 | 38 | void remove_session(std::shared_ptr<ms::Session> const& session) override; | 37 | mir::scene::SurfaceCreationParameters const& requestParameters, |
461 | 39 | 38 | std::function<mir::frontend::SurfaceId(std::shared_ptr<mir::scene::Session> const& session, mir::scene::SurfaceCreationParameters const& params)> const& build) | |
462 | 40 | mir::frontend::SurfaceId add_surface( | 39 | -> mir::frontend::SurfaceId |
408 | 41 | std::shared_ptr<ms::Session> const& session, | ||
409 | 42 | ms::SurfaceCreationParameters const& params, | ||
410 | 43 | std::function<mir::frontend::SurfaceId(std::shared_ptr<ms::Session> const& session, ms::SurfaceCreationParameters const& params)> const& build) override; | ||
411 | 44 | |||
412 | 45 | void remove_surface( | ||
413 | 46 | std::shared_ptr<ms::Session> const& session, | ||
414 | 47 | std::weak_ptr<ms::Surface> const& surface) override; | ||
415 | 48 | |||
416 | 49 | void add_display(mir::geometry::Rectangle const& area) override; | ||
417 | 50 | |||
418 | 51 | void remove_display(mir::geometry::Rectangle const& area) override; | ||
419 | 52 | |||
420 | 53 | bool handle_keyboard_event(MirKeyboardEvent const* event) override; | ||
421 | 54 | |||
422 | 55 | bool handle_touch_event(MirTouchEvent const* event) override; | ||
423 | 56 | |||
424 | 57 | bool handle_pointer_event(MirPointerEvent const* event) override; | ||
425 | 58 | |||
426 | 59 | int set_surface_attribute( | ||
427 | 60 | std::shared_ptr<ms::Session> const& session, | ||
428 | 61 | std::shared_ptr<ms::Surface> const& surface, | ||
429 | 62 | MirSurfaceAttrib attrib, | ||
430 | 63 | int value) override; | ||
431 | 64 | |||
432 | 65 | void modify_surface(const std::shared_ptr<mir::scene::Session>&, const std::shared_ptr<mir::scene::Surface>&, const mir::shell::SurfaceSpecification&); | ||
433 | 66 | }; | ||
434 | 67 | } | ||
435 | 68 | |||
436 | 69 | |||
437 | 70 | MirShell::MirShell( | ||
438 | 71 | const std::shared_ptr<mir::shell::InputTargeter> &inputTargeter, | ||
439 | 72 | const std::shared_ptr<mir::scene::SurfaceCoordinator> &surfaceCoordinator, | ||
440 | 73 | const std::shared_ptr<mir::scene::SessionCoordinator> &sessionCoordinator, | ||
441 | 74 | const std::shared_ptr<mir::scene::PromptSessionManager> &promptSessionManager, | ||
442 | 75 | const std::shared_ptr<mir::shell::DisplayLayout> &displayLayout) : | ||
443 | 76 | AbstractShell(inputTargeter, surfaceCoordinator, sessionCoordinator, promptSessionManager, | ||
444 | 77 | [](mir::shell::FocusController*) { return std::make_shared<NullWindowManager>(); }), | ||
445 | 78 | m_displayLayout{displayLayout} | ||
446 | 79 | { | ||
447 | 80 | qCDebug(QTMIR_MIR_MESSAGES) << "MirShell::MirShell"; | ||
448 | 81 | } | ||
449 | 82 | |||
450 | 83 | mir::frontend::SurfaceId MirShell::create_surface(const std::shared_ptr<ms::Session> &session, const ms::SurfaceCreationParameters &requestParameters) | ||
463 | 84 | { | 40 | { |
464 | 85 | tracepoint(qtmirserver, surfacePlacementStart); | 41 | tracepoint(qtmirserver, surfacePlacementStart); |
465 | 86 | 42 | ||
489 | 87 | // TODO: Callback unity8 so that it can make a decision on that. | 43 | // TODO: Callback unity8 so that it can make a decision on that. |
490 | 88 | // unity8 must bear in mind that the called function will be on a Mir thread though. | 44 | // unity8 must bear in mind that the called function will be on a Mir thread though. |
491 | 89 | // The QPA shouldn't be deciding for itself on such things. | 45 | // The QPA shouldn't be deciding for itself on such things. |
492 | 90 | 46 | ||
493 | 91 | ms::SurfaceCreationParameters placedParameters = requestParameters; | 47 | ms::SurfaceCreationParameters placedParameters = requestParameters; |
494 | 92 | 48 | ||
495 | 93 | // Just make it fullscreen for now | 49 | // Just make it fullscreen for now |
496 | 94 | mir::geometry::Rectangle rect{requestParameters.top_left, requestParameters.size}; | 50 | mir::geometry::Rectangle rect{requestParameters.top_left, requestParameters.size}; |
497 | 95 | m_displayLayout->size_to_output(rect); | 51 | m_displayLayout->size_to_output(rect); |
498 | 96 | placedParameters.size = rect.size; | 52 | placedParameters.size = rect.size; |
499 | 97 | 53 | ||
500 | 98 | qCDebug(QTMIR_MIR_MESSAGES) << "MirShell::create_surface(): size requested (" | 54 | qCDebug(QTMIR_MIR_MESSAGES) << "MirWindowManager::add_surface(): size requested (" |
501 | 99 | << requestParameters.size.width.as_int() << "," << requestParameters.size.height.as_int() << ") and placed (" | 55 | << requestParameters.size.width.as_int() << "," << requestParameters.size.height.as_int() << ") and placed (" |
502 | 100 | << placedParameters.size.width.as_int() << "," << placedParameters.size.height.as_int() << ")"; | 56 | << placedParameters.size.width.as_int() << "," << placedParameters.size.height.as_int() << ")"; |
503 | 101 | 57 | ||
504 | 102 | tracepoint(qtmirserver, surfacePlacementEnd); | 58 | tracepoint(qtmirserver, surfacePlacementEnd); |
505 | 103 | 59 | ||
506 | 104 | return AbstractShell::create_surface(session, placedParameters); | 60 | return build(session, placedParameters); |
507 | 105 | } | 61 | } |
508 | 106 | 62 | ||
509 | 107 | int MirShell::set_surface_attribute( | 63 | void MirWindowManager::modify_surface( |
510 | 108 | const std::shared_ptr<mir::scene::Session> &session, | 64 | std::shared_ptr<mir::scene::Session> const& /*session*/, |
511 | 109 | const std::shared_ptr<mir::scene::Surface> &surface, | 65 | std::shared_ptr<mir::scene::Surface> const& surface, |
512 | 66 | mir::shell::SurfaceSpecification const& modifications) | ||
513 | 67 | { | ||
514 | 68 | // TODO ought to wire up some window management logic around here | ||
515 | 69 | // Here's a very basic implementation | ||
516 | 70 | |||
517 | 71 | if (modifications.name.is_set()) | ||
518 | 72 | surface->rename(modifications.name.value()); | ||
519 | 73 | |||
520 | 74 | if (modifications.width.is_set() || modifications.height.is_set()) | ||
521 | 75 | { | ||
522 | 76 | auto new_size = surface->size(); | ||
523 | 77 | |||
524 | 78 | if (modifications.width.is_set()) | ||
525 | 79 | new_size.width = modifications.width.value(); | ||
526 | 80 | |||
527 | 81 | if (modifications.height.is_set()) | ||
528 | 82 | new_size.height = modifications.height.value(); | ||
529 | 83 | |||
530 | 84 | surface->resize(new_size); | ||
531 | 85 | } | ||
532 | 86 | } | ||
533 | 87 | |||
534 | 88 | int MirWindowManager::set_surface_attribute( | ||
535 | 89 | std::shared_ptr<mir::scene::Session> const& /*session*/, | ||
536 | 90 | std::shared_ptr<mir::scene::Surface> const& surface, | ||
537 | 110 | MirSurfaceAttrib attrib, | 91 | MirSurfaceAttrib attrib, |
538 | 111 | int value) | 92 | int value) |
539 | 112 | { | 93 | { |
541 | 113 | auto const result = AbstractShell::set_surface_attribute(session, surface, attrib, value); | 94 | const auto result = surface->configure(attrib, value); |
542 | 114 | Q_EMIT surfaceAttributeChanged(surface.get(), attrib, result); | 95 | Q_EMIT surfaceAttributeChanged(surface.get(), attrib, result); |
543 | 115 | |||
544 | 116 | return result; | 96 | return result; |
545 | 117 | } | 97 | } |
546 | 118 | 98 | ||
604 | 119 | void NullWindowManager::add_session(std::shared_ptr<ms::Session> const& /*session*/) | 99 | void MirWindowManager::add_session(std::shared_ptr<mir::scene::Session> const& /*session*/) |
605 | 120 | { | 100 | { |
606 | 121 | } | 101 | } |
607 | 122 | 102 | ||
608 | 123 | void NullWindowManager::remove_session(std::shared_ptr<ms::Session> const& /*session*/) | 103 | void MirWindowManager::remove_session(std::shared_ptr<mir::scene::Session> const& /*session*/) |
609 | 124 | { | 104 | { |
610 | 125 | } | 105 | } |
611 | 126 | 106 | ||
612 | 127 | auto NullWindowManager::add_surface( | 107 | void MirWindowManager::remove_surface( |
613 | 128 | std::shared_ptr<ms::Session> const& session, | 108 | std::shared_ptr<mir::scene::Session> const& /*session*/, |
614 | 129 | ms::SurfaceCreationParameters const& params, | 109 | std::weak_ptr<mir::scene::Surface> const& /*surface*/) |
615 | 130 | std::function<mir::frontend::SurfaceId(std::shared_ptr<ms::Session> const& session, ms::SurfaceCreationParameters const& params)> const& build) | 110 | { |
616 | 131 | -> mir::frontend::SurfaceId | 111 | } |
617 | 132 | { | 112 | |
618 | 133 | return build(session, params); | 113 | void MirWindowManager::add_display(mir::geometry::Rectangle const& /*area*/) |
619 | 134 | } | 114 | { |
620 | 135 | 115 | } | |
621 | 136 | void NullWindowManager::remove_surface( | 116 | |
622 | 137 | std::shared_ptr<ms::Session> const& /*session*/, | 117 | void MirWindowManager::remove_display(mir::geometry::Rectangle const& /*area*/) |
623 | 138 | std::weak_ptr<ms::Surface> const& /*surface*/) | 118 | { |
624 | 139 | { | 119 | } |
625 | 140 | } | 120 | |
626 | 141 | 121 | bool MirWindowManager::handle_keyboard_event(MirKeyboardEvent const* /*event*/) | |
627 | 142 | void NullWindowManager::add_display(mir::geometry::Rectangle const& /*area*/) | 122 | { |
628 | 143 | { | 123 | return false; |
629 | 144 | } | 124 | } |
630 | 145 | 125 | ||
631 | 146 | void NullWindowManager::remove_display(mir::geometry::Rectangle const& /*area*/) | 126 | bool MirWindowManager::handle_touch_event(MirTouchEvent const* /*event*/) |
632 | 147 | { | 127 | { |
633 | 148 | } | 128 | return false; |
634 | 149 | 129 | } | |
635 | 150 | bool NullWindowManager::handle_keyboard_event(MirKeyboardEvent const* /*event*/) | 130 | |
636 | 151 | { | 131 | bool MirWindowManager::handle_pointer_event(MirPointerEvent const* /*event*/) |
637 | 152 | return false; | 132 | { |
638 | 153 | } | 133 | return false; |
582 | 154 | |||
583 | 155 | bool NullWindowManager::handle_touch_event(MirTouchEvent const* /*event*/) | ||
584 | 156 | { | ||
585 | 157 | return false; | ||
586 | 158 | } | ||
587 | 159 | |||
588 | 160 | bool NullWindowManager::handle_pointer_event(MirPointerEvent const* /*event*/) | ||
589 | 161 | { | ||
590 | 162 | return false; | ||
591 | 163 | } | ||
592 | 164 | |||
593 | 165 | int NullWindowManager::set_surface_attribute( | ||
594 | 166 | std::shared_ptr<ms::Session> const& /*session*/, | ||
595 | 167 | std::shared_ptr<ms::Surface> const& surface, | ||
596 | 168 | MirSurfaceAttrib attrib, | ||
597 | 169 | int value) | ||
598 | 170 | { | ||
599 | 171 | return surface->configure(attrib, value); | ||
600 | 172 | } | ||
601 | 173 | |||
602 | 174 | void NullWindowManager::modify_surface(const std::shared_ptr<mir::scene::Session>&, const std::shared_ptr<mir::scene::Surface>&, const mir::shell::SurfaceSpecification&) | ||
603 | 175 | { | ||
639 | 176 | } | 134 | } |
640 | 177 | 135 | ||
641 | === renamed file 'src/platforms/mirserver/mirshell.h' => 'src/platforms/mirserver/mirwindowmanager.h' | |||
642 | --- src/platforms/mirserver/mirshell.h 2015-02-04 17:17:53 +0000 | |||
643 | +++ src/platforms/mirserver/mirwindowmanager.h 2015-05-06 15:47:57 +0000 | |||
644 | @@ -14,10 +14,10 @@ | |||
645 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
646 | 15 | */ | 15 | */ |
647 | 16 | 16 | ||
650 | 17 | #ifndef QPAMIRSERVER_SHELL_H | 17 | #ifndef MIRWINDOWMANAGER_H |
651 | 18 | #define QPAMIRSERVER_SHELL_H | 18 | #define MIRWINDOWMANAGER_H |
652 | 19 | 19 | ||
654 | 20 | #include <mir/shell/abstract_shell.h> | 20 | #include <mir/shell/window_manager.h> |
655 | 21 | #include <QObject> | 21 | #include <QObject> |
656 | 22 | 22 | ||
657 | 23 | namespace mir { | 23 | namespace mir { |
658 | @@ -26,26 +26,45 @@ | |||
659 | 26 | } | 26 | } |
660 | 27 | } | 27 | } |
661 | 28 | 28 | ||
663 | 29 | class MirShell : public QObject, public mir::shell::AbstractShell | 29 | class MirWindowManager : public QObject, public mir::shell::WindowManager |
664 | 30 | { | 30 | { |
665 | 31 | Q_OBJECT | 31 | Q_OBJECT |
666 | 32 | 32 | ||
667 | 33 | public: | 33 | public: |
674 | 34 | MirShell( | 34 | explicit MirWindowManager(const std::shared_ptr<mir::shell::DisplayLayout> &displayLayout); |
669 | 35 | const std::shared_ptr<mir::shell::InputTargeter> &inputTargeter, | ||
670 | 36 | const std::shared_ptr<mir::scene::SurfaceCoordinator> &surfaceCoordinator, | ||
671 | 37 | const std::shared_ptr<mir::scene::SessionCoordinator> &sessionCoordinator, | ||
672 | 38 | const std::shared_ptr<mir::scene::PromptSessionManager> &promptSessionManager, | ||
673 | 39 | const std::shared_ptr<mir::shell::DisplayLayout> &displayLayout); | ||
675 | 40 | 35 | ||
677 | 41 | virtual mir::frontend::SurfaceId create_surface(const std::shared_ptr<mir::scene::Session>& session, const mir::scene::SurfaceCreationParameters ¶ms); | 36 | auto add_surface( |
678 | 37 | std::shared_ptr<mir::scene::Session> const& session, | ||
679 | 38 | mir::scene::SurfaceCreationParameters const& params, | ||
680 | 39 | std::function<mir::frontend::SurfaceId(std::shared_ptr<mir::scene::Session> const& session, mir::scene::SurfaceCreationParameters const& params)> const& build) | ||
681 | 40 | -> mir::frontend::SurfaceId override; | ||
682 | 42 | 41 | ||
683 | 43 | int set_surface_attribute( | 42 | int set_surface_attribute( |
686 | 44 | const std::shared_ptr<mir::scene::Session> &session, | 43 | std::shared_ptr<mir::scene::Session> const& session, |
687 | 45 | const std::shared_ptr<mir::scene::Surface> &surface, | 44 | std::shared_ptr<mir::scene::Surface> const& surface, |
688 | 46 | MirSurfaceAttrib attrib, | 45 | MirSurfaceAttrib attrib, |
689 | 47 | int value) override; | 46 | int value) override; |
690 | 48 | 47 | ||
691 | 48 | void add_session(std::shared_ptr<mir::scene::Session> const& session) override; | ||
692 | 49 | |||
693 | 50 | void remove_session(std::shared_ptr<mir::scene::Session> const& session) override; | ||
694 | 51 | |||
695 | 52 | void remove_surface( | ||
696 | 53 | std::shared_ptr<mir::scene::Session> const& session, | ||
697 | 54 | std::weak_ptr<mir::scene::Surface> const& surface) override; | ||
698 | 55 | |||
699 | 56 | void modify_surface(std::shared_ptr<mir::scene::Session> const&, std::shared_ptr<mir::scene::Surface> const&, mir::shell::SurfaceSpecification const&); | ||
700 | 57 | |||
701 | 58 | void add_display(mir::geometry::Rectangle const& area) override; | ||
702 | 59 | |||
703 | 60 | void remove_display(mir::geometry::Rectangle const& area) override; | ||
704 | 61 | |||
705 | 62 | bool handle_keyboard_event(MirKeyboardEvent const* event) override; | ||
706 | 63 | |||
707 | 64 | bool handle_touch_event(MirTouchEvent const* event) override; | ||
708 | 65 | |||
709 | 66 | bool handle_pointer_event(MirPointerEvent const* event) override; | ||
710 | 67 | |||
711 | 49 | Q_SIGNALS: | 68 | Q_SIGNALS: |
712 | 50 | void surfaceAttributeChanged(mir::scene::Surface const*, const MirSurfaceAttrib, const int); | 69 | void surfaceAttributeChanged(mir::scene::Surface const*, const MirSurfaceAttrib, const int); |
713 | 51 | 70 | ||
714 | @@ -53,4 +72,4 @@ | |||
715 | 53 | std::shared_ptr<mir::shell::DisplayLayout> const m_displayLayout; | 72 | std::shared_ptr<mir::shell::DisplayLayout> const m_displayLayout; |
716 | 54 | }; | 73 | }; |
717 | 55 | 74 | ||
719 | 56 | #endif /* QPAMIRSERVER_SHELL_H */ | 75 | #endif /* MIRWINDOWMANAGER_H */ |
720 | 57 | 76 | ||
721 | === modified file 'src/platforms/mirserver/nativeinterface.cpp' | |||
722 | --- src/platforms/mirserver/nativeinterface.cpp 2015-01-28 14:25:36 +0000 | |||
723 | +++ src/platforms/mirserver/nativeinterface.cpp 2015-05-06 15:47:57 +0000 | |||
724 | @@ -29,12 +29,17 @@ | |||
725 | 29 | 29 | ||
726 | 30 | if (resource == "SessionAuthorizer") | 30 | if (resource == "SessionAuthorizer") |
727 | 31 | result = m_mirServer->sessionAuthorizer(); | 31 | result = m_mirServer->sessionAuthorizer(); |
730 | 32 | else if (resource == "Shell") | 32 | else if (resource == "WindowManager") |
731 | 33 | result = m_mirServer->shell(); | 33 | result = m_mirServer->windowManager(); |
732 | 34 | else if (resource == "SessionListener") | 34 | else if (resource == "SessionListener") |
733 | 35 | result = m_mirServer->sessionListener(); | 35 | result = m_mirServer->sessionListener(); |
734 | 36 | else if (resource == "PromptSessionListener") | 36 | else if (resource == "PromptSessionListener") |
735 | 37 | result = m_mirServer->promptSessionListener(); | 37 | result = m_mirServer->promptSessionListener(); |
736 | 38 | else if (resource == "mir::shell::Shell") | ||
737 | 39 | { | ||
738 | 40 | const std::weak_ptr<mir::shell::Shell> shell{m_mirServer->the_shell()}; | ||
739 | 41 | result = shell.lock().get(); | ||
740 | 42 | } | ||
741 | 38 | 43 | ||
742 | 39 | return result; | 44 | return result; |
743 | 40 | } | 45 | } |
744 | 41 | 46 | ||
745 | === modified file 'src/platforms/mirserver/nativeinterface.h' | |||
746 | --- src/platforms/mirserver/nativeinterface.h 2014-12-01 11:05:01 +0000 | |||
747 | +++ src/platforms/mirserver/nativeinterface.h 2015-05-06 15:47:57 +0000 | |||
748 | @@ -33,7 +33,7 @@ | |||
749 | 33 | 33 | ||
750 | 34 | virtual void *nativeResourceForIntegration(const QByteArray &resource); | 34 | virtual void *nativeResourceForIntegration(const QByteArray &resource); |
751 | 35 | 35 | ||
753 | 36 | QSharedPointer<MirServer> m_mirServer; | 36 | const QSharedPointer<MirServer> m_mirServer; |
754 | 37 | }; | 37 | }; |
755 | 38 | 38 | ||
756 | 39 | #endif // NATIVEINTEGRATION_H | 39 | #endif // NATIVEINTEGRATION_H |
757 | 40 | 40 | ||
758 | === modified file 'tests/modules/common/qtmir_test.h' | |||
759 | --- tests/modules/common/qtmir_test.h 2015-02-06 09:47:21 +0000 | |||
760 | +++ tests/modules/common/qtmir_test.h 2015-05-06 15:47:57 +0000 | |||
761 | @@ -109,7 +109,6 @@ | |||
762 | 109 | &applicationManager, | 109 | &applicationManager, |
763 | 110 | } | 110 | } |
764 | 111 | , surfaceManager{ | 111 | , surfaceManager{ |
765 | 112 | mirServer, | ||
766 | 113 | mirShell, | 112 | mirShell, |
767 | 114 | &sessionManager | 113 | &sessionManager |
768 | 115 | } | 114 | } |
769 | @@ -150,7 +149,7 @@ | |||
770 | 150 | testing::NiceMock<testing::MockDesktopFileReaderFactory> desktopFileReaderFactory; | 149 | testing::NiceMock<testing::MockDesktopFileReaderFactory> desktopFileReaderFactory; |
771 | 151 | testing::NiceMock<testing::MockSharedWakelock> sharedWakelock; | 150 | testing::NiceMock<testing::MockSharedWakelock> sharedWakelock; |
772 | 152 | QSharedPointer<FakeMirServer> mirServer; | 151 | QSharedPointer<FakeMirServer> mirServer; |
774 | 153 | MirShell *mirShell{nullptr}; | 152 | mir::shell::Shell *mirShell{nullptr}; |
775 | 154 | QSharedPointer<TaskController> taskController; | 153 | QSharedPointer<TaskController> taskController; |
776 | 155 | ApplicationManager applicationManager; | 154 | ApplicationManager applicationManager; |
777 | 156 | SessionManager sessionManager; | 155 | SessionManager sessionManager; |
FAILED: Continuous integration, rev:340 jenkins. qa.ubuntu. com/job/ qtmir-ci/ 244/ jenkins. qa.ubuntu. com/job/ qtmir-vivid- amd64-ci/ 95/console jenkins. qa.ubuntu. com/job/ qtmir-vivid- armhf-ci/ 95/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/qtmir- ci/244/ rebuild
http://