Merge lp:~alan-griffiths/miral/compatibility-with-mir-trunk into lp:miral

Proposed by Alan Griffiths on 2016-08-05
Status: Merged
Approved by: Gerry Boland on 2016-08-08
Approved revision: 262
Merged at revision: 261
Proposed branch: lp:~alan-griffiths/miral/compatibility-with-mir-trunk
Merge into: lp:miral
Prerequisite: lp:~alan-griffiths/miral/fix-qtmir-WindowModel
Diff against target: 163 lines (+37/-8)
8 files modified
miral-qt/src/modules/Unity/Application/mirsurfaceitem.cpp (+0/-3)
miral-qt/src/modules/Unity/Application/upstart/applicationinfo.h (+1/-3)
miral-qt/src/platforms/mirserver/miropenglcontext.cpp (+10/-0)
miral-qt/src/platforms/mirserver/screen.cpp (+2/-2)
miral-qt/tests/framework/fake_surface.h (+6/-0)
miral-qt/tests/framework/mock_display.h (+5/-0)
miral-qt/tests/framework/mock_mir_session.h (+7/-0)
miral-qt/tests/framework/mock_surface.h (+6/-0)
To merge this branch: bzr merge lp:~alan-griffiths/miral/compatibility-with-mir-trunk
Reviewer Review Type Date Requested Status
Gerry Boland 2016-08-05 Approve on 2016-08-08
Andreas Pokorny (community) Approve on 2016-08-08
Review via email: mp+302137@code.launchpad.net

Commit Message

Conditionals to handle lp:mir API changes

To post a comment you must log in.
Alan Griffiths (alan-griffiths) wrote :

The #pragmas removed are rejected by g++-6

Gerry Boland (gerboland) wrote :

 #pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Werror"
 #include <private/qsgdefaultimagenode_p.h>
#pragma GCC diagnostic pop

you can remove all the #pragma lines here, the push/pop pointless if you remove the instruction (ignores).

review: Needs Fixing
261. By Alan Griffiths on 2016-08-08

Nit fix

262. By Alan Griffiths on 2016-08-08

merge lp:miral

Alan Griffiths (alan-griffiths) wrote :

> you can remove all the #pragma lines here, the push/pop pointless if you
> remove the instruction (ignores).

Done

Andreas Pokorny (andreas-pokorny) wrote :

ok

review: Approve
Gerry Boland (gerboland) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'miral-qt/src/modules/Unity/Application/mirsurfaceitem.cpp'
2--- miral-qt/src/modules/Unity/Application/mirsurfaceitem.cpp 2016-07-26 12:45:17 +0000
3+++ miral-qt/src/modules/Unity/Application/mirsurfaceitem.cpp 2016-08-08 11:13:36 +0000
4@@ -33,10 +33,7 @@
5 #include <QQmlEngine>
6 #include <QQuickWindow>
7 #include <QScreen>
8-#pragma GCC diagnostic push
9-#pragma GCC diagnostic ignored "-Werror"
10 #include <private/qsgdefaultimagenode_p.h>
11-#pragma GCC diagnostic pop
12 #include <QTimer>
13 #include <QSGTextureProvider>
14
15
16=== modified file 'miral-qt/src/modules/Unity/Application/upstart/applicationinfo.h'
17--- miral-qt/src/modules/Unity/Application/upstart/applicationinfo.h 2016-06-01 22:06:51 +0000
18+++ miral-qt/src/modules/Unity/Application/upstart/applicationinfo.h 2016-08-08 11:13:36 +0000
19@@ -19,10 +19,8 @@
20 #define UPSTART_APPLICATION_INFO_H
21
22 #include "../applicationinfo.h"
23-#pragma GCC diagnostic push
24-#pragma GCC diagnostic ignored "-Werror"
25+
26 #include <ubuntu-app-launch/application.h>
27-#pragma GCC diagnostic pop
28
29 namespace qtmir
30 {
31
32=== modified file 'miral-qt/src/platforms/mirserver/miropenglcontext.cpp'
33--- miral-qt/src/platforms/mirserver/miropenglcontext.cpp 2016-06-21 13:38:53 +0000
34+++ miral-qt/src/platforms/mirserver/miropenglcontext.cpp 2016-08-08 11:13:36 +0000
35@@ -30,6 +30,12 @@
36 // Mir
37 #include <mir/graphics/display.h>
38 #include <mir/graphics/gl_context.h>
39+#include <mir/version.h>
40+#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0)
41+#include <mir/renderer/gl/context_source.h>
42+#include <mir/renderer/gl/context.h>
43+#endif
44+
45
46 // Qt supports one GL context per screen, but also shared contexts.
47 // The Mir "Display" generates a shared GL context for all DisplayBuffers
48@@ -45,7 +51,11 @@
49 #endif
50 {
51 // create a temporary GL context to fetch the EGL display and config, so Qt can determine the surface format
52+#if MIR_SERVER_VERSION < MIR_VERSION_NUMBER(0, 25, 0)
53 std::unique_ptr<mir::graphics::GLContext> mirContext = display.create_gl_context();
54+#else
55+ auto const mirContext = dynamic_cast<mir::renderer::gl::ContextSource&>(display).create_gl_context();
56+#endif
57 mirContext->make_current();
58
59 EGLDisplay eglDisplay = eglGetCurrentDisplay();
60
61=== modified file 'miral-qt/src/platforms/mirserver/screen.cpp'
62--- miral-qt/src/platforms/mirserver/screen.cpp 2016-07-21 09:30:45 +0000
63+++ miral-qt/src/platforms/mirserver/screen.cpp 2016-08-08 11:13:36 +0000
64@@ -214,8 +214,8 @@
65 m_type = screen.type;
66
67 // Physical screen size
68- m_physicalSize.setWidth(screen.physical_size_mm.width.as_float());
69- m_physicalSize.setHeight(screen.physical_size_mm.height.as_float());
70+ m_physicalSize.setWidth(screen.physical_size_mm.width.as_int());
71+ m_physicalSize.setHeight(screen.physical_size_mm.height.as_int());
72
73 // Screen capabilities
74 m_currentModeIndex = screen.current_mode_index;
75
76=== modified file 'miral-qt/tests/framework/fake_surface.h'
77--- miral-qt/tests/framework/fake_surface.h 2016-06-07 20:32:04 +0000
78+++ miral-qt/tests/framework/fake_surface.h 2016-08-08 11:13:36 +0000
79@@ -20,6 +20,7 @@
80 #define MIR_SCENE_FAKESURFACE_H_
81
82 #include <mir/scene/surface.h>
83+#include <mir/version.h>
84 #include "stub_input_channel.h"
85
86 #include <memory>
87@@ -100,6 +101,11 @@
88 void set_cursor_stream(std::shared_ptr<frontend::BufferStream> const&, geometry::Displacement const&) {}
89 void rename(std::string const&) {}
90 std::shared_ptr<frontend::BufferStream> primary_buffer_stream() const override { return nullptr; }
91+
92+#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0)
93+ void set_confine_pointer_state(MirPointerConfinementState) {}
94+ MirPointerConfinementState confine_pointer_state() const { return {}; }
95+#endif
96 };
97
98 } // namespace scene
99
100=== modified file 'miral-qt/tests/framework/mock_display.h'
101--- miral-qt/tests/framework/mock_display.h 2016-06-01 22:06:51 +0000
102+++ miral-qt/tests/framework/mock_display.h 2016-08-08 11:13:36 +0000
103@@ -61,6 +61,11 @@
104 #if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 20, 0)
105 MOCK_METHOD2(create_virtual_output, std::unique_ptr<mir::graphics::VirtualOutput> (int width, int height));
106 #endif
107+
108+#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0)
109+ mir::graphics::NativeDisplay* native_display() { return nullptr; }
110+#endif
111+
112 };
113
114 #endif // MOCKDISPLAY_H
115
116=== modified file 'miral-qt/tests/framework/mock_mir_session.h'
117--- miral-qt/tests/framework/mock_mir_session.h 2016-06-01 22:06:51 +0000
118+++ miral-qt/tests/framework/mock_mir_session.h 2016-08-08 11:13:36 +0000
119@@ -20,6 +20,7 @@
120 #include <mir/scene/session.h>
121 #include <mir/graphics/display_configuration.h>
122 #include <mir/scene/surface_creation_parameters.h>
123+#include <mir/version.h>
124 #include <gmock/gmock.h>
125
126 #include <string>
127@@ -72,6 +73,12 @@
128
129
130 private:
131+
132+#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0)
133+ graphics::BufferID create_buffer(graphics::BufferProperties const&) { return graphics::BufferID{0}; }
134+ void destroy_buffer(graphics::BufferID) {}
135+ std::shared_ptr<graphics::Buffer> get_buffer(graphics::BufferID) { return {}; }
136+#endif
137 std::string m_sessionName;
138 pid_t m_sessionId;
139 };
140
141=== modified file 'miral-qt/tests/framework/mock_surface.h'
142--- miral-qt/tests/framework/mock_surface.h 2016-06-01 22:06:51 +0000
143+++ miral-qt/tests/framework/mock_surface.h 2016-08-08 11:13:36 +0000
144@@ -18,6 +18,7 @@
145 #define MOCK_MIR_SCENE_SURFACE_H
146
147 #include <mir/scene/surface.h>
148+#include <mir/version.h>
149 #include <gmock/gmock.h>
150
151 #include <string>
152@@ -87,6 +88,11 @@
153 MOCK_METHOD1(with_most_recent_buffer_do, void(std::function<void(graphics::Buffer&)> const& exec));
154
155 MOCK_METHOD2(set_cursor_stream, void(std::shared_ptr<frontend::BufferStream> const&, geometry::Displacement const&));
156+
157+#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0)
158+ void set_confine_pointer_state(MirPointerConfinementState) {}
159+ MirPointerConfinementState confine_pointer_state() const { return {}; }
160+#endif
161 };
162
163 } // namespace scene

Subscribers

People subscribed via source and target branches