Merge lp:~alan-griffiths/miral/hide-streams-from-Window-Management-API into lp:miral

Proposed by Alan Griffiths
Status: Merged
Approved by: Gerry Boland
Approved revision: 310
Merged at revision: 313
Proposed branch: lp:~alan-griffiths/miral/hide-streams-from-Window-Management-API
Merge into: lp:miral
Diff against target: 324 lines (+16/-160)
7 files modified
debian/libmiral1.symbols (+0/-2)
include/miral/stream_specification.h (+0/-42)
include/miral/window_specification.h (+7/-5)
miral/CMakeLists.txt (+0/-1)
miral/basic_window_manager.cpp (+0/-25)
miral/symbols.map (+0/-1)
miral/window_specification.cpp (+9/-84)
To merge this branch: bzr merge lp:~alan-griffiths/miral/hide-streams-from-Window-Management-API
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+304626@code.launchpad.net

Commit message

Don't expose BufferStreams to window management when creating or modifying windows.

To post a comment you must log in.
Revision history for this message
Chris Halse Rogers (raof) wrote :

It's not clear why you're removing pixel_format(), buffer_usage(), and content_id() at the same time. Is that deliberate?

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> It's not clear why you're removing pixel_format(), buffer_usage(), and
> content_id() at the same time. Is that deliberate?

Well, it could have been a separate MP, but they are also properties that WM shouldn't be (and AFAICS isn't) messing with.

Revision history for this message
Chris Halse Rogers (raof) wrote :

Hm. My understanding is that those *are* things the shell might want to mess with or, rather, to deny creating a window with certain properties.

So the WM doesn't need to deal with them, no, but something in MirAL might?

310. By Alan Griffiths

Remove dead file from CMakeLists.txt

Revision history for this message
Gerry Boland (gerboland) wrote :

I don't need this yet - perhaps I never will. Ok to remove

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/libmiral1.symbols'
2--- debian/libmiral1.symbols 2016-08-29 09:19:00 +0000
3+++ debian/libmiral1.symbols 2016-09-05 10:38:36 +0000
4@@ -229,8 +229,6 @@
5 (c++)"miral::WindowSpecification::size()@MIRAL_0.1" 0.1.0
6 (c++)"miral::WindowSpecification::state() const@MIRAL_0.1" 0.1.0
7 (c++)"miral::WindowSpecification::state()@MIRAL_0.1" 0.1.0
8- (c++)"miral::WindowSpecification::streams() const@MIRAL_0.1" 0.1.0
9- (c++)"miral::WindowSpecification::streams()@MIRAL_0.1" 0.1.0
10 (c++)"miral::WindowSpecification::top_left() const@MIRAL_0.1" 0.1.0
11 (c++)"miral::WindowSpecification::top_left()@MIRAL_0.1" 0.1.0
12 (c++)"miral::WindowSpecification::type() const@MIRAL_0.1" 0.1.0
13
14=== removed file 'include/miral/stream_specification.h'
15--- include/miral/stream_specification.h 2016-04-29 13:34:54 +0000
16+++ include/miral/stream_specification.h 1970-01-01 00:00:00 +0000
17@@ -1,42 +0,0 @@
18-/*
19- * Copyright © 2016 Canonical Ltd.
20- *
21- * This program is free software: you can redistribute it and/or modify it
22- * under the terms of the GNU General Public License version 3,
23- * as published by the Free Software Foundation.
24- *
25- * This program is distributed in the hope that it will be useful,
26- * but WITHOUT ANY WARRANTY; without even the implied warranty of
27- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28- * GNU General Public License for more details.
29- *
30- * You should have received a copy of the GNU General Public License
31- * along with this program. If not, see <http://www.gnu.org/licenses/>.
32- *
33- * Authored by: Alan Griffiths <alan@octopull.co.uk>
34- */
35-
36-#ifndef MIRAL_STREAM_SPECIFICATION_H
37-#define MIRAL_STREAM_SPECIFICATION_H
38-
39-#include <mir/int_wrapper.h>
40-#include <mir/geometry/displacement.h>
41-#include <mir/geometry/size.h>
42-#include <mir/optional_value.h>
43-
44-namespace miral
45-{
46-using namespace mir::geometry;
47-
48-namespace detail { struct SessionsBufferStreamIdTag; }
49-typedef mir::IntWrapper<detail::SessionsBufferStreamIdTag> BufferStreamId;
50-
51-struct StreamSpecification
52-{
53- BufferStreamId stream_id;
54- Displacement displacement;
55- mir::optional_value<mir::geometry::Size> size;
56-};
57-}
58-
59-#endif //MIRAL_STREAM_SPECIFICATION_H
60
61=== modified file 'include/miral/window_specification.h'
62--- include/miral/window_specification.h 2016-08-29 14:26:01 +0000
63+++ include/miral/window_specification.h 2016-09-05 10:38:36 +0000
64@@ -19,12 +19,13 @@
65 #ifndef MIRAL_WINDOW_SPECIFICATION_H
66 #define MIRAL_WINDOW_SPECIFICATION_H
67
68-#include "miral/stream_specification.h"
69-
70 #include <mir_toolkit/common.h>
71 #include <mir_toolkit/version.h>
72+
73+#include <mir/geometry/displacement.h>
74+#include <mir/geometry/rectangles.h>
75 #include <mir/optional_value.h>
76-#include <mir/geometry/rectangles.h>
77+#include <mir/int_wrapper.h>
78
79 #include <memory>
80
81@@ -100,6 +101,8 @@
82 namespace miral
83 {
84 using namespace mir::geometry;
85+namespace detail { struct SessionsBufferStreamIdTag; }
86+typedef mir::IntWrapper<detail::SessionsBufferStreamIdTag> BufferStreamId;
87
88 class WindowSpecification
89 {
90@@ -153,7 +156,7 @@
91 auto height_inc() const -> mir::optional_value<DeltaY> const&;
92 auto min_aspect() const -> mir::optional_value<AspectRatio> const&;
93 auto max_aspect() const -> mir::optional_value<AspectRatio> const&;
94- auto streams() const -> mir::optional_value<std::vector<StreamSpecification>> const&;
95+
96 auto parent() const -> mir::optional_value<std::weak_ptr<mir::scene::Surface>> const&;
97 auto input_shape() const -> mir::optional_value<std::vector<Rectangle>> const&;
98 auto input_mode() const -> mir::optional_value<InputReceptionMode> const&;
99@@ -182,7 +185,6 @@
100 auto height_inc() -> mir::optional_value<DeltaY>&;
101 auto min_aspect() -> mir::optional_value<AspectRatio>&;
102 auto max_aspect() -> mir::optional_value<AspectRatio>&;
103- auto streams() -> mir::optional_value<std::vector<StreamSpecification>>&;
104 auto parent() -> mir::optional_value<std::weak_ptr<mir::scene::Surface>>&;
105 auto input_shape() -> mir::optional_value<std::vector<Rectangle>>&;
106 auto input_mode() -> mir::optional_value<InputReceptionMode>&;
107
108=== modified file 'miral/CMakeLists.txt'
109--- miral/CMakeLists.txt 2016-08-29 22:21:17 +0000
110+++ miral/CMakeLists.txt 2016-09-05 10:38:36 +0000
111@@ -40,7 +40,6 @@
112 set_window_managment_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_window_managment_policy.h
113 window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_policy.h
114 window_manager_tools.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_manager_tools.h
115- ${CMAKE_SOURCE_DIR}/include/miral/stream_specification.h
116 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/surface_spec.h
117 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/persistent_id.h
118 ${CMAKE_SOURCE_DIR}/include/miral/toolkit/connection.h
119
120=== modified file 'miral/basic_window_manager.cpp'
121--- miral/basic_window_manager.cpp 2016-08-29 16:17:16 +0000
122+++ miral/basic_window_manager.cpp 2016-09-05 10:38:36 +0000
123@@ -586,31 +586,6 @@
124 if (modifications.name().is_set())
125 std::shared_ptr<scene::Surface>(window)->rename(modifications.name().value());
126
127- if (modifications.streams().is_set())
128- {
129- auto const& config = modifications.streams().value();
130-
131- std::vector<shell::StreamSpecification> dest;
132- dest.reserve(config.size());
133-
134-#if MIR_SERVER_VERSION < MIR_VERSION_NUMBER(0, 22, 0)
135- for (auto const& stream : config)
136- dest.push_back(
137- shell::StreamSpecification{frontend::BufferStreamId{stream.stream_id.as_value()}, stream.displacement});
138-#else
139- for (auto const& stream : config)
140- {
141- dest.push_back(
142- mir::shell::StreamSpecification{
143- mir::frontend::BufferStreamId{stream.stream_id.as_value()},
144- stream.displacement,
145- stream.size
146- });
147- }
148-#endif
149- window.application()->configure_streams(*std::shared_ptr<scene::Surface>(window), dest);
150- }
151-
152 if (modifications.input_shape().is_set())
153 std::shared_ptr<scene::Surface>(window)->set_input_region(modifications.input_shape().value());
154
155
156=== modified file 'miral/symbols.map'
157--- miral/symbols.map 2016-08-29 09:19:00 +0000
158+++ miral/symbols.map 2016-09-05 10:38:36 +0000
159@@ -186,7 +186,6 @@
160 miral::WindowSpecification::shell_chrome*;
161 miral::WindowSpecification::size*;
162 miral::WindowSpecification::state*;
163- miral::WindowSpecification::streams*;
164 miral::WindowSpecification::top_left*;
165 miral::WindowSpecification::type*;
166 miral::WindowSpecification::update*;
167
168=== modified file 'miral/window_specification.cpp'
169--- miral/window_specification.cpp 2016-08-29 11:17:18 +0000
170+++ miral/window_specification.cpp 2016-09-05 10:38:36 +0000
171@@ -54,7 +54,7 @@
172 mir::optional_value<DeltaY> height_inc;
173 mir::optional_value<AspectRatio> min_aspect;
174 mir::optional_value<AspectRatio> max_aspect;
175- mir::optional_value<std::vector<StreamSpecification>> streams;
176+ mir::optional_value<std::vector<mir::shell::StreamSpecification>> streams;
177 mir::optional_value<std::weak_ptr<mir::scene::Surface>> parent;
178 mir::optional_value<std::vector<Rectangle>> input_shape;
179 mir::optional_value<InputReceptionMode> input_mode;
180@@ -80,7 +80,7 @@
181 height_inc(spec.height_inc),
182 min_aspect(),
183 max_aspect(),
184- streams(),
185+ streams(spec.streams),
186 parent(spec.parent),
187 input_shape(spec.input_shape),
188 input_mode(),
189@@ -124,36 +124,6 @@
190
191 if (spec.max_aspect.is_set())
192 max_aspect = AspectRatio{spec.max_aspect.value().width, spec.max_aspect.value().height};
193-
194- if (spec.streams.is_set())
195- {
196- auto const& source = spec.streams.value();
197- std::vector<StreamSpecification> dest;
198- dest.reserve(source.size());
199-
200-#if MIR_SERVER_VERSION < MIR_VERSION_NUMBER(0, 22, 0)
201- for (auto const& stream : source)
202- {
203- dest.push_back(
204- StreamSpecification{
205- BufferStreamId{stream.stream_id.as_value()},
206- stream.displacement,
207- mir::optional_value<mir::geometry::Size>{}
208- });
209- }
210-#else
211- for (auto const& stream : source)
212- {
213- dest.push_back(
214- StreamSpecification{
215- BufferStreamId{stream.stream_id.as_value()},
216- stream.displacement,
217- stream.size
218- });
219- }
220-#endif
221- streams = std::move(dest);
222- }
223 }
224
225 namespace
226@@ -242,7 +212,11 @@
227 height_inc(params.height_inc),
228 min_aspect(),
229 max_aspect(),
230+#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 22, 0)
231+ streams(params.streams),
232+#else
233 streams(),
234+#endif
235 parent(params.parent),
236 input_shape(params.input_shape),
237 input_mode(static_cast<InputReceptionMode>(params.input_mode)),
238@@ -280,27 +254,6 @@
239
240 if (params.max_aspect.is_set())
241 max_aspect = AspectRatio{params.max_aspect.value().width, params.max_aspect.value().height};
242-
243-#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 22, 0)
244- if (params.streams.is_set())
245- {
246- auto const& source = params.streams.value();
247- std::vector<StreamSpecification> dest;
248- dest.reserve(source.size());
249-
250- for (auto const& stream : source)
251- {
252- dest.push_back(
253- StreamSpecification{
254- BufferStreamId{stream.stream_id.as_value()},
255- stream.displacement,
256- stream.size
257- });
258- }
259-
260- streams = std::move(dest);
261- }
262-#endif
263 }
264
265 void miral::WindowSpecification::Self::update(mir::scene::SurfaceCreationParameters& params) const
266@@ -324,31 +277,13 @@
267 copy_if_set(params.height_inc, height_inc);
268 copy_if_set(params.min_aspect, min_aspect);
269 copy_if_set(params.max_aspect, max_aspect);
270+#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 22, 0)
271+ copy_if_set(params.streams, streams);
272+#endif
273 copy_if_set(params.parent, parent);
274 copy_if_set(params.input_shape, input_shape);
275 copy_if_set(params.input_mode, input_mode);
276 copy_if_set(params.shell_chrome, shell_chrome);
277-
278-#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 22, 0)
279- if (streams.is_set())
280- {
281- auto const& source = streams.value();
282- std::vector<mir::shell::StreamSpecification> dest;
283- dest.reserve(source.size());
284-
285- for (auto const& stream : source)
286- {
287- dest.push_back(
288- mir::shell::StreamSpecification{
289- mir::frontend::BufferStreamId{stream.stream_id.as_value()},
290- stream.displacement,
291- stream.size
292- });
293- }
294-
295- params.streams = std::move(dest);
296- }
297-#endif
298 }
299
300 miral::WindowSpecification::WindowSpecification() :
301@@ -494,11 +429,6 @@
302 return self->max_aspect;
303 }
304
305-auto miral::WindowSpecification::streams() const -> mir::optional_value<std::vector<StreamSpecification>> const&
306-{
307- return self->streams;
308-}
309-
310 auto miral::WindowSpecification::parent() const -> mir::optional_value<std::weak_ptr<mir::scene::Surface>> const&
311 {
312 return self->parent;
313@@ -634,11 +564,6 @@
314 return self->max_aspect;
315 }
316
317-auto miral::WindowSpecification::streams() -> mir::optional_value<std::vector<StreamSpecification>>&
318-{
319- return self->streams;
320-}
321-
322 auto miral::WindowSpecification::parent() -> mir::optional_value<std::weak_ptr<mir::scene::Surface>>&
323 {
324 return self->parent;

Subscribers

People subscribed via source and target branches