Merge lp:~gerboland/qtubuntu/enable-debug-mode into lp:qtubuntu
- enable-debug-mode
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Daniel d'Andrada |
Approved revision: | 294 |
Merged at revision: | 349 |
Proposed branch: | lp:~gerboland/qtubuntu/enable-debug-mode |
Merge into: | lp:qtubuntu |
Diff against target: |
376 lines (+141/-19) 11 files modified
debian/control (+1/-0) src/ubuntumirclient/debugextension.cpp (+55/-0) src/ubuntumirclient/debugextension.h (+39/-0) src/ubuntumirclient/integration.cpp (+15/-2) src/ubuntumirclient/integration.h (+4/-1) src/ubuntumirclient/logging.h (+1/-0) src/ubuntumirclient/plugin.cpp (+5/-11) src/ubuntumirclient/plugin.h (+2/-3) src/ubuntumirclient/ubuntumirclient.pro (+2/-0) src/ubuntumirclient/window.cpp (+13/-1) src/ubuntumirclient/window.h (+4/-1) |
To merge this branch: | bzr merge lp:~gerboland/qtubuntu/enable-debug-mode |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot | continuous-integration | Approve | |
Daniel d'Andrada (community) | Approve | ||
Michael Terry | Pending | ||
Nick Dedekind | Pending | ||
PS Jenkins bot | continuous-integration | Pending | |
Review via email: mp+306527@code.launchpad.net |
This proposal supersedes a proposal from 2015-10-30.
Commit message
Use mir-client-debug to map window coordinates to screen coordinates
If client detects testability framework was enabled, try to load the mir-client-debug library and use it to implement UbuntuWindow:
Description of the change
Use mir-client-debug to map window coordinates to screen coordinates when under testability
To work with unity8 it needs https:/
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:283
http://
Executed test runs:
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
To test, handiest is to apply this patch: http://
mir_demo_shell --debug
and start any qt app with "-testability" flag.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:283
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
Does this mean we can remove UbuntuWindow:
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
And how about QPlatformWindow
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
Yep, it lets us remove the panelHeight hack. Could also implement mapFromGlobal too, but I didn't see a use-case
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
rebase please :)
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
Afraid this will not work unless we get https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:283
https:/
Executed test runs:
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
> Afraid this will not work unless we get
> https:/
It will work as long as application code calls "window-
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
It has a bunch of conflicts with trunk. Solved them here: lp:~dandrader/qtubuntu/enable-debug-mode
Feel free to branch it, squash its history and push it here with --overwrite.
This branch, along with lp:~dandrader/qtmir/coordinateTranslator, should be all autopilot folks need for mapping local points to screen points (regardless of any translations, rotations and scalings done by unity8 to the application surface)
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:287
https:/
Executed test runs:
SUCCESS: https:/
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 : Posted in a previous version of this proposal | # |
It works.
Michael Terry (mterry) wrote : Posted in a previous version of this proposal | # |
This conflicts with trunk now. :(
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:287
https:/
Executed test runs:
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
Lot's of conflicts with trunk:
"""
Text conflict in src/ubuntumircl
Text conflict in src/ubuntumircl
Text conflict in src/ubuntumircl
Text conflict in src/ubuntumircl
4 conflicts encountered.
"""
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
I pushed to the actual right branch this time!
Michael Terry (mterry) wrote : Posted in a previous version of this proposal | # |
OK, conflicts fixed.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:290
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:291
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
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:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
"""
+ qDebug() << "NOTICE: Loading mirclient-
"""
Do we want to keep that? If so, better categorize it so that people know where does it come from when seeing it in the console
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
Updated
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
Those changes in src/ubuntumircl
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:293
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:/
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 : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:294
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:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 292. By Gerry Boland
-
Merge trunk
- 293. By Gerry Boland
-
Use category logging for debug extension warnings
- 294. By Gerry Boland
-
Use dedicated logging category for debug-related messages
Gerry Boland (gerboland) wrote : | # |
Apologies, bad branch management on my part. All fixed now
Daniel d'Andrada (dandrader) wrote : | # |
Looking good.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:294
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:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 295. By Gerry Boland
-
Merge trunk
Preview Diff
1 | === modified file 'debian/control' |
2 | --- debian/control 2016-08-24 12:40:30 +0000 |
3 | +++ debian/control 2016-10-04 16:22:27 +0000 |
4 | @@ -11,6 +11,7 @@ |
5 | libglib2.0-dev, |
6 | libinput-dev, |
7 | libmirclient-dev (>= 0.13.0), |
8 | + libmirclient-debug-extension-dev, |
9 | libmtdev-dev, |
10 | libubuntu-application-api-dev (>= 2.9.0), |
11 | libudev-dev, |
12 | |
13 | === added file 'src/ubuntumirclient/debugextension.cpp' |
14 | --- src/ubuntumirclient/debugextension.cpp 1970-01-01 00:00:00 +0000 |
15 | +++ src/ubuntumirclient/debugextension.cpp 2016-10-04 16:22:27 +0000 |
16 | @@ -0,0 +1,55 @@ |
17 | +/* |
18 | + * Copyright (C) 2016 Canonical, Ltd. |
19 | + * |
20 | + * This program is free software: you can redistribute it and/or modify it under |
21 | + * the terms of the GNU Lesser General Public License version 3, as published by |
22 | + * the Free Software Foundation. |
23 | + * |
24 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
25 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
26 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
27 | + * Lesser General Public License for more details. |
28 | + * |
29 | + * You should have received a copy of the GNU Lesser General Public License |
30 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
31 | + */ |
32 | + |
33 | +#include "debugextension.h" |
34 | + |
35 | +#include "logging.h" |
36 | + |
37 | +// mir client debug |
38 | +#include <mir_toolkit/debug/surface.h> |
39 | + |
40 | +Q_LOGGING_CATEGORY(ubuntumirclientDebug, "ubuntumirclient.debug") |
41 | + |
42 | +UbuntuDebugExtension::UbuntuDebugExtension() |
43 | + : m_mirclientDebug(QStringLiteral("mirclient-debug-extension"), 1) |
44 | + , m_mapper(nullptr) |
45 | +{ |
46 | + qCDebug(ubuntumirclientDebug) << "NOTICE: Loading mirclient-debug-extension"; |
47 | + m_mapper = (MapperPrototype) m_mirclientDebug.resolve("mir_debug_surface_coords_to_screen"); |
48 | + |
49 | + if (!m_mirclientDebug.isLoaded()) { |
50 | + qCWarning(ubuntumirclientDebug) << "ERROR: mirclient-debug-extension failed to load:" |
51 | + << m_mirclientDebug.errorString(); |
52 | + } else if (!m_mapper) { |
53 | + qCWarning(ubuntumirclientDebug) << "ERROR: unable to find required symbols in mirclient-debug-extension:" |
54 | + << m_mirclientDebug.errorString(); |
55 | + } |
56 | +} |
57 | + |
58 | +QPoint UbuntuDebugExtension::mapSurfacePointToScreen(MirSurface *surface, const QPoint &point) |
59 | +{ |
60 | + if (!m_mapper) { |
61 | + return point; |
62 | + } |
63 | + |
64 | + QPoint mappedPoint; |
65 | + bool status = m_mapper(surface, point.x(), point.y(), &mappedPoint.rx(), &mappedPoint.ry()); |
66 | + if (status) { |
67 | + return mappedPoint; |
68 | + } else { |
69 | + return point; |
70 | + } |
71 | +} |
72 | |
73 | === added file 'src/ubuntumirclient/debugextension.h' |
74 | --- src/ubuntumirclient/debugextension.h 1970-01-01 00:00:00 +0000 |
75 | +++ src/ubuntumirclient/debugextension.h 2016-10-04 16:22:27 +0000 |
76 | @@ -0,0 +1,39 @@ |
77 | +/* |
78 | + * Copyright (C) 2016 Canonical, Ltd. |
79 | + * |
80 | + * This program is free software: you can redistribute it and/or modify it under |
81 | + * the terms of the GNU Lesser General Public License version 3, as published by |
82 | + * the Free Software Foundation. |
83 | + * |
84 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
85 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
86 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
87 | + * Lesser General Public License for more details. |
88 | + * |
89 | + * You should have received a copy of the GNU Lesser General Public License |
90 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
91 | + */ |
92 | + |
93 | +#ifndef UBUNTU_DEBUG_EXTENSION_H |
94 | +#define UBUNTU_DEBUG_EXTENSION_H |
95 | + |
96 | +#include <QPoint> |
97 | +#include <QLibrary> |
98 | +struct MirSurface; |
99 | + |
100 | +typedef bool (*MapperPrototype)(MirSurface* surface, int x, int y, int* screenX, int* screenY); |
101 | + |
102 | + |
103 | +class UbuntuDebugExtension |
104 | +{ |
105 | +public: |
106 | + UbuntuDebugExtension(); |
107 | + |
108 | + QPoint mapSurfacePointToScreen(MirSurface *, const QPoint &point); |
109 | + |
110 | +private: |
111 | + QLibrary m_mirclientDebug; |
112 | + MapperPrototype m_mapper; |
113 | +}; |
114 | + |
115 | +#endif // UBUNTU_DEBUG_EXTENSION_H |
116 | |
117 | === modified file 'src/ubuntumirclient/integration.cpp' |
118 | --- src/ubuntumirclient/integration.cpp 2016-09-28 10:51:25 +0000 |
119 | +++ src/ubuntumirclient/integration.cpp 2016-10-04 16:22:27 +0000 |
120 | @@ -18,6 +18,7 @@ |
121 | #include "integration.h" |
122 | #include "backingstore.h" |
123 | #include "clipboard.h" |
124 | +#include "debugextension.h" |
125 | #include "glcontext.h" |
126 | #include "input.h" |
127 | #include "logging.h" |
128 | @@ -70,7 +71,8 @@ |
129 | QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended); |
130 | } |
131 | |
132 | -UbuntuClientIntegration::UbuntuClientIntegration() |
133 | + |
134 | +UbuntuClientIntegration::UbuntuClientIntegration(int argc, char **argv) |
135 | : QPlatformIntegration() |
136 | , mNativeInterface(new UbuntuNativeInterface(this)) |
137 | , mFontDb(new QGenericUnixFontDatabase) |
138 | @@ -105,6 +107,17 @@ |
139 | mEglNativeDisplay = mir_connection_get_egl_native_display(mMirConnection); |
140 | ASSERT((mEglDisplay = eglGetDisplay(mEglNativeDisplay)) != EGL_NO_DISPLAY); |
141 | ASSERT(eglInitialize(mEglDisplay, nullptr, nullptr) == EGL_TRUE); |
142 | + |
143 | + // Has debug mode been requsted, either with "-testability" switch or QT_LOAD_TESTABILITY env var |
144 | + bool testability = qEnvironmentVariableIsSet("QT_LOAD_TESTABILITY"); |
145 | + for (int i=1; !testability && i<argc; i++) { |
146 | + if (strcmp(argv[i], "-testability") == 0) { |
147 | + testability = true; |
148 | + } |
149 | + } |
150 | + if (testability) { |
151 | + mDebugExtension.reset(new UbuntuDebugExtension); |
152 | + } |
153 | } |
154 | |
155 | void UbuntuClientIntegration::initialize() |
156 | @@ -211,7 +224,7 @@ |
157 | |
158 | QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window) const |
159 | { |
160 | - return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection); |
161 | + return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection, mDebugExtension.data()); |
162 | } |
163 | |
164 | bool UbuntuClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const |
165 | |
166 | === modified file 'src/ubuntumirclient/integration.h' |
167 | --- src/ubuntumirclient/integration.h 2016-08-24 12:40:30 +0000 |
168 | +++ src/ubuntumirclient/integration.h 2016-10-04 16:22:27 +0000 |
169 | @@ -29,6 +29,7 @@ |
170 | |
171 | #include <EGL/egl.h> |
172 | |
173 | +class UbuntuDebugExtension; |
174 | class UbuntuInput; |
175 | class UbuntuNativeInterface; |
176 | class UbuntuScreen; |
177 | @@ -39,7 +40,7 @@ |
178 | Q_OBJECT |
179 | |
180 | public: |
181 | - UbuntuClientIntegration(); |
182 | + UbuntuClientIntegration(int argc, char **argv); |
183 | virtual ~UbuntuClientIntegration(); |
184 | |
185 | // QPlatformIntegration methods. |
186 | @@ -64,6 +65,7 @@ |
187 | EGLDisplay eglDisplay() const { return mEglDisplay; } |
188 | EGLNativeDisplayType eglNativeDisplay() const { return mEglNativeDisplay; } |
189 | UbuntuScreenObserver *screenObserver() const { return mScreenObserver.data(); } |
190 | + UbuntuDebugExtension *debugExtension() const { return mDebugExtension.data(); } |
191 | |
192 | private Q_SLOTS: |
193 | void destroyScreen(UbuntuScreen *screen); |
194 | @@ -81,6 +83,7 @@ |
195 | |
196 | UbuntuInput* mInput; |
197 | QPlatformInputContext* mInputContext; |
198 | + QScopedPointer<UbuntuDebugExtension> mDebugExtension; |
199 | QScopedPointer<UbuntuScreenObserver> mScreenObserver; |
200 | qreal mScaleFactor; |
201 | |
202 | |
203 | === modified file 'src/ubuntumirclient/logging.h' |
204 | --- src/ubuntumirclient/logging.h 2016-06-22 17:16:33 +0000 |
205 | +++ src/ubuntumirclient/logging.h 2016-10-04 16:22:27 +0000 |
206 | @@ -26,5 +26,6 @@ |
207 | Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientInput) |
208 | Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientGraphics) |
209 | Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientCursor) |
210 | +Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientDebug) |
211 | |
212 | #endif // QUBUNTULOGGING_H |
213 | |
214 | === modified file 'src/ubuntumirclient/plugin.cpp' |
215 | --- src/ubuntumirclient/plugin.cpp 2015-12-04 16:19:33 +0000 |
216 | +++ src/ubuntumirclient/plugin.cpp 2016-10-04 16:22:27 +0000 |
217 | @@ -1,5 +1,5 @@ |
218 | /* |
219 | - * Copyright (C) 2014 Canonical, Ltd. |
220 | + * Copyright (C) 2014-2016 Canonical, Ltd. |
221 | * |
222 | * This program is free software: you can redistribute it and/or modify it under |
223 | * the terms of the GNU Lesser General Public License version 3, as published by |
224 | @@ -20,15 +20,9 @@ |
225 | |
226 | Q_LOGGING_CATEGORY(ubuntumirclient, "ubuntumirclient", QtWarningMsg) |
227 | |
228 | -QStringList UbuntuMirClientIntegrationPlugin::keys() const |
229 | -{ |
230 | - QStringList list; |
231 | - list << QStringLiteral("ubuntumirclient"); |
232 | - return list; |
233 | -} |
234 | - |
235 | -QPlatformIntegration* UbuntuMirClientIntegrationPlugin::create(const QString &system, |
236 | - const QStringList &) |
237 | +QPlatformIntegration *UbuntuMirClientIntegrationPlugin::create(const QString &system, |
238 | + const QStringList &/*paramList*/, |
239 | + int &argc, char **argv) |
240 | { |
241 | if (system.toLower() == QLatin1String("ubuntumirclient")) { |
242 | #ifdef PLATFORM_API_TOUCH |
243 | @@ -36,7 +30,7 @@ |
244 | #else |
245 | setenv("UBUNTU_PLATFORM_API_BACKEND", "desktop_mirclient", 1); |
246 | #endif |
247 | - return new UbuntuClientIntegration; |
248 | + return new UbuntuClientIntegration(argc, argv); |
249 | } else { |
250 | return 0; |
251 | } |
252 | |
253 | === modified file 'src/ubuntumirclient/plugin.h' |
254 | --- src/ubuntumirclient/plugin.h 2014-06-18 23:10:00 +0000 |
255 | +++ src/ubuntumirclient/plugin.h 2016-10-04 16:22:27 +0000 |
256 | @@ -1,5 +1,5 @@ |
257 | /* |
258 | - * Copyright (C) 2014 Canonical, Ltd. |
259 | + * Copyright (C) 2014-2016 Canonical, Ltd. |
260 | * |
261 | * This program is free software: you can redistribute it and/or modify it under |
262 | * the terms of the GNU Lesser General Public License version 3, as published by |
263 | @@ -25,8 +25,7 @@ |
264 | Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "ubuntumirclient.json") |
265 | |
266 | public: |
267 | - QStringList keys() const; |
268 | - QPlatformIntegration* create(const QString&, const QStringList&); |
269 | + QPlatformIntegration *create(const QString &system, const QStringList ¶mList, int &argc, char **argv) override; |
270 | }; |
271 | |
272 | #endif // UBUNTU_CLIENT_PLUGIN_H |
273 | |
274 | === modified file 'src/ubuntumirclient/ubuntumirclient.pro' |
275 | --- src/ubuntumirclient/ubuntumirclient.pro 2016-09-28 10:51:25 +0000 |
276 | +++ src/ubuntumirclient/ubuntumirclient.pro 2016-10-04 16:22:27 +0000 |
277 | @@ -18,6 +18,7 @@ |
278 | backingstore.cpp \ |
279 | clipboard.cpp \ |
280 | cursor.cpp \ |
281 | + debugextension.cpp \ |
282 | glcontext.cpp \ |
283 | input.cpp \ |
284 | integration.cpp \ |
285 | @@ -33,6 +34,7 @@ |
286 | backingstore.h \ |
287 | clipboard.h \ |
288 | cursor.h \ |
289 | + debugextension.h \ |
290 | glcontext.h \ |
291 | input.h \ |
292 | integration.h \ |
293 | |
294 | === modified file 'src/ubuntumirclient/window.cpp' |
295 | --- src/ubuntumirclient/window.cpp 2016-09-28 10:33:40 +0000 |
296 | +++ src/ubuntumirclient/window.cpp 2016-10-04 16:22:27 +0000 |
297 | @@ -16,8 +16,10 @@ |
298 | |
299 | // Local |
300 | #include "window.h" |
301 | +#include "debugextension.h" |
302 | #include "nativeinterface.h" |
303 | #include "input.h" |
304 | +#include "integration.h" |
305 | #include "screen.h" |
306 | #include "logging.h" |
307 | |
308 | @@ -600,13 +602,14 @@ |
309 | } |
310 | |
311 | UbuntuWindow::UbuntuWindow(QWindow *w, UbuntuInput *input, UbuntuNativeInterface *native, |
312 | - EGLDisplay eglDisplay, MirConnection *mirConnection) |
313 | + EGLDisplay eglDisplay, MirConnection *mirConnection, UbuntuDebugExtension *debugExt) |
314 | : QObject(nullptr) |
315 | , QPlatformWindow(w) |
316 | , mId(makeId()) |
317 | , mWindowState(w->windowState()) |
318 | , mWindowFlags(w->flags()) |
319 | , mWindowVisible(false) |
320 | + , mDebugExtention(debugExt) |
321 | , mNativeInterface(native) |
322 | , mSurface(new UbuntuSurface{this, eglDisplay, input, mirConnection}) |
323 | , mScale(1.0) |
324 | @@ -819,6 +822,15 @@ |
325 | return mSurface->format(); |
326 | } |
327 | |
328 | +QPoint UbuntuWindow::mapToGlobal(const QPoint &pos) const |
329 | +{ |
330 | + if (mDebugExtention) { |
331 | + return mDebugExtention->mapSurfacePointToScreen(mSurface->mirSurface(), pos); |
332 | + } else { |
333 | + return pos; |
334 | + } |
335 | +} |
336 | + |
337 | void* UbuntuWindow::eglSurface() const |
338 | { |
339 | return mSurface->eglSurface(); |
340 | |
341 | === modified file 'src/ubuntumirclient/window.h' |
342 | --- src/ubuntumirclient/window.h 2016-09-21 10:25:33 +0000 |
343 | +++ src/ubuntumirclient/window.h 2016-10-04 16:22:27 +0000 |
344 | @@ -27,6 +27,7 @@ |
345 | |
346 | #include <EGL/egl.h> |
347 | |
348 | +class UbuntuDebugExtension; |
349 | class UbuntuNativeInterface; |
350 | class UbuntuInput; |
351 | class UbuntuScreen; |
352 | @@ -39,7 +40,7 @@ |
353 | Q_OBJECT |
354 | public: |
355 | UbuntuWindow(QWindow *w, UbuntuInput *input, UbuntuNativeInterface* native, EGLDisplay eglDisplay, |
356 | - MirConnection *mirConnection); |
357 | + MirConnection *mirConnection, UbuntuDebugExtension *debugExt); |
358 | virtual ~UbuntuWindow(); |
359 | |
360 | // QPlatformWindow methods. |
361 | @@ -52,6 +53,7 @@ |
362 | void propagateSizeHints() override; |
363 | bool isExposed() const override; |
364 | |
365 | + QPoint mapToGlobal(const QPoint &pos) const override; |
366 | QSurfaceFormat format() const override; |
367 | |
368 | // Additional Window properties exposed by NativeInterface |
369 | @@ -79,6 +81,7 @@ |
370 | Qt::WindowFlags mWindowFlags; |
371 | bool mWindowVisible; |
372 | bool mWindowExposed; |
373 | + UbuntuDebugExtension *mDebugExtention; |
374 | UbuntuNativeInterface *mNativeInterface; |
375 | std::unique_ptr<UbuntuSurface> mSurface; |
376 | float mScale; |
Note: this requires work on unity8's side before it is functional. But it works with mir-demo-server.
Also note, mir only supports this mir-client-debug extension if the mir server is started with the --debug argument.
This will be a problem for application autopilot testing, as it will require unity8 to be restarted with the --debug flag now.