Mir

Merge lp:~robertcarr/mir/remove-mir-disable-input into lp:~mir-team/mir/trunk

Proposed by Robert Carr
Status: Merged
Approved by: Robert Carr
Approved revision: no longer in the source branch.
Merged at revision: 559
Proposed branch: lp:~robertcarr/mir/remove-mir-disable-input
Merge into: lp:~mir-team/mir/trunk
Diff against target: 333 lines (+69/-91)
13 files modified
3rd_party/CMakeLists.txt (+2/-6)
CMakeLists.txt (+0/-7)
cross-compile-chroot.sh (+0/-1)
debian/rules (+0/-1)
doc/building_source_for_android.md (+2/-2)
examples/render_surfaces.cpp (+2/-16)
include/server/mir/input/null_input_manager.h (+56/-0)
src/server/default_server_configuration.cpp (+7/-2)
src/server/input/CMakeLists.txt (+0/-7)
src/server/input/dummy_input_manager.cpp (+0/-42)
tests/integration-tests/CMakeLists.txt (+0/-2)
tests/mir_test_doubles/CMakeLists.txt (+0/-2)
tests/unit-tests/CMakeLists.txt (+0/-3)
To merge this branch: bzr merge lp:~robertcarr/mir/remove-mir-disable-input
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Daniel van Vugt Needs Resubmitting
Kevin DuBois (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+156696@code.launchpad.net

Commit message

Remove MIR_DISABLE_INPUT build option and replace with a runtime option.

Description of the change

Remove MIR_DISABLE_INPUT build option and replace with a runtime option.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

looks good as far as the scripts/docs/android etc go. this also reminded me that our android install script isn't working too well... I can take care of that though.

only issue, and its pre-existing, so i'll +1 the mp, but:
170: pre-existing issue, but we return an empty shared_ptr. is there anything else we could do?

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

You forgot to set prereqisite = lp:~robertcarr/mir/dedupe-null-input-managers

Changes from that branch should not be visible in this proposal.

review: Needs Resubmitting
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also, I thought bug 1157613 would hold this back. But that bug has magically been resolved at some point.

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

Fine apart from the incorrect dependency on lp:~robertcarr/mir/dedupe-null-input-managers - but if that lands, I'm happy with this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/CMakeLists.txt'
2--- 3rd_party/CMakeLists.txt 2013-03-21 03:32:59 +0000
3+++ 3rd_party/CMakeLists.txt 2013-04-02 21:14:24 +0000
4@@ -28,10 +28,8 @@
5 add_subdirectory(android-fbtype)
6 endif()
7
8-if (NOT MIR_DISABLE_INPUT)
9- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/android-deps)
10- add_subdirectory(android-input)
11-endif()
12+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/android-deps)
13+add_subdirectory(android-input)
14
15 set(MIR_ANDROID_INCLUDE_DIRECTORIES ${MIR_ANDROID_INCLUDE_DIRECTORIES} PARENT_SCOPE)
16 set(
17@@ -39,9 +37,7 @@
18 ${MIR_ANDROID_INPUT_COMPILE_FLAGS}
19 PARENT_SCOPE)
20
21-if (NOT MIR_DISABLE_INPUT)
22 target_link_libraries(
23 3rd_party
24
25 android-input)
26-endif()
27
28=== modified file 'CMakeLists.txt'
29--- CMakeLists.txt 2013-03-28 14:20:06 +0000
30+++ CMakeLists.txt 2013-04-02 21:14:24 +0000
31@@ -103,13 +103,6 @@
32 "graphics backend to build (options are 'gbm' or 'android')"
33 )
34
35-set (MIR_DISABLE_INPUT
36- false
37- CACHE
38- BOOL
39- "Don't build the input subsystem"
40-)
41-
42 set (MIR_INPUT_USE_ANDROID_TYPES
43 false
44 CACHE
45
46=== modified file 'cross-compile-chroot.sh'
47--- cross-compile-chroot.sh 2013-03-26 15:55:51 +0000
48+++ cross-compile-chroot.sh 2013-04-02 21:14:24 +0000
49@@ -26,7 +26,6 @@
50 -DBoost_COMPILER=-gcc \
51 -DMIR_ENABLE_DEATH_TESTS=NO \
52 -DMIR_PLATFORM=android \
53- -DMIR_DISABLE_INPUT=true \
54 ..
55
56 cmake --build .
57
58=== modified file 'debian/rules'
59--- debian/rules 2013-03-13 04:54:15 +0000
60+++ debian/rules 2013-04-02 21:14:24 +0000
61@@ -15,7 +15,6 @@
62
63 COMMON_CONFIGURE_OPTIONS = \
64 -DMIR_DISABLE_EPOLL_REACTOR=YES \
65- -DMIR_DISABLE_INPUT=YES \
66 -DBUILD_DOXYGEN=YES
67
68 # We need to rely on the select-based reactor to fix the ppa builds.
69
70=== modified file 'doc/building_source_for_android.md'
71--- doc/building_source_for_android.md 2013-03-26 16:30:53 +0000
72+++ doc/building_source_for_android.md 2013-04-02 21:14:24 +0000
73@@ -42,7 +42,7 @@
74
75 $ bzr branch lp:mir
76 $ mkdir mir/build; cd mir/build
77- $ cmake -DBoost_COMPILER=-gcc -DMIR_ENABLE_DEATH_TESTS=NO -DMIR_PLATFORM=android -DMIR_DISABLE_INPUT=yes ..
78+ $ cmake -DBoost_COMPILER=-gcc -DMIR_ENABLE_DEATH_TESTS=NO -DMIR_PLATFORM=android ..
79
80 Cross Compile
81 -------------
82@@ -63,7 +63,7 @@
83
84 $ bzr branch lp:mir
85 $ mkdir mir/build; cd mir/build
86- $ MIR_NDK_PATH=/path/to/depenendcies/chroot cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/LinuxCrossCompile.cmake -DBoost_COMPILER=-gcc -DMIR_ENABLE_DEATH_TESTS=NO -DMIR_PLATFORM=android -DMIR_DISABLE_INPUT=yes ..
87+ $ MIR_NDK_PATH=/path/to/depenendcies/chroot cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/LinuxCrossCompile.cmake -DBoost_COMPILER=-gcc -DMIR_ENABLE_DEATH_TESTS=NO -DMIR_PLATFORM=android ..
88 $ make
89
90 N.B. The `cross-compile-android.sh` script in mir's top level directory
91
92=== modified file 'examples/render_surfaces.cpp'
93--- examples/render_surfaces.cpp 2013-04-02 09:36:09 +0000
94+++ examples/render_surfaces.cpp 2013-04-02 21:14:24 +0000
95@@ -23,7 +23,7 @@
96 #include "mir/geometry/size.h"
97 #include "mir/graphics/buffer_initializer.h"
98 #include "mir/graphics/display.h"
99-#include "mir/input/input_manager.h"
100+#include "mir/input/null_input_manager.h"
101 #include "mir/shell/surface_builder.h"
102 #include "mir/surfaces/surface.h"
103 #include "mir/default_server_configuration.h"
104@@ -380,20 +380,6 @@
105 // Stub out input.
106 std::shared_ptr<mi::InputManager> RenderSurfacesServerConfiguration::the_input_manager()
107 {
108- struct NullInputManager : public mi::InputManager
109- {
110- void start() {}
111- void stop() {}
112- std::shared_ptr<mi::InputChannel> make_input_channel()
113- {
114- return std::shared_ptr<mi::InputChannel>();
115- }
116- void set_input_focus_to(std::shared_ptr<mi::SessionTarget> const& /* session */,
117- std::shared_ptr<mi::SurfaceTarget> const& /* surface */)
118- {
119- }
120- };
121-
122- return std::make_shared<NullInputManager>();
123+ return std::make_shared<mi::NullInputManager>();
124 }
125 ///\internal [NullInputManager_tag]
126
127=== added file 'include/server/mir/input/null_input_manager.h'
128--- include/server/mir/input/null_input_manager.h 1970-01-01 00:00:00 +0000
129+++ include/server/mir/input/null_input_manager.h 2013-04-02 21:14:24 +0000
130@@ -0,0 +1,56 @@
131+/*
132+ * Copyright © 2013 Canonical Ltd.
133+ *
134+ * This program is free software: you can redistribute it and/or modify it
135+ * under the terms of the GNU Lesser General Public License version 3,
136+ * as published by the Free Software Foundation.
137+ *
138+ * This program is distributed in the hope that it will be useful,
139+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
140+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
141+ * GNU General Public License for more details.
142+ *
143+ * You should have received a copy of the GNU Lesser General Public License
144+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
145+ *
146+ * Authored by: Robert Carr <robert.carr@canonical.com>
147+ */
148+
149+#ifndef MIR_INPUT_NULL_INPUT_MANAGER_H_
150+#define MIR_INPUT_NULL_INPUT_MANAGER_H_
151+
152+#include "mir/input/input_manager.h"
153+
154+namespace mir
155+{
156+namespace input
157+{
158+
159+class NullInputManager : public InputManager
160+{
161+public:
162+ NullInputManager() {};
163+ virtual ~NullInputManager() {}
164+
165+ void start() {}
166+ void stop() {}
167+
168+ std::shared_ptr<InputChannel> make_input_channel()
169+ {
170+ return std::shared_ptr<InputChannel>();
171+ }
172+
173+ virtual void set_input_focus_to(std::shared_ptr<input::SessionTarget> const& /* session */,
174+ std::shared_ptr<input::SurfaceTarget> const& /* surface */)
175+ {
176+ }
177+
178+protected:
179+ NullInputManager(const NullInputManager&) = delete;
180+ NullInputManager& operator=(const NullInputManager&) = delete;
181+};
182+
183+}
184+}
185+
186+#endif // MIR_INPUT_NULL_INPUT_MANAGER
187
188=== modified file 'src/server/default_server_configuration.cpp'
189--- src/server/default_server_configuration.cpp 2013-03-28 14:20:06 +0000
190+++ src/server/default_server_configuration.cpp 2013-04-02 21:14:24 +0000
191@@ -44,6 +44,7 @@
192 #include "mir/graphics/buffer_initializer.h"
193 #include "mir/graphics/null_display_report.h"
194 #include "mir/input/input_manager.h"
195+#include "mir/input/null_input_manager.h"
196 #include "mir/logging/logger.h"
197 #include "mir/logging/dumb_console_logger.h"
198 #include "mir/logging/glog_logger.h"
199@@ -140,6 +141,7 @@
200 "Environment variables capitalise long form with prefix \"MIR_SERVER_\" and \"_\" in place of \"-\"");
201 desc.add_options()
202 ("file,f", po::value<std::string>(), "Socket filename")
203+ ("enable-input,i", po::value<bool>(), "Enable input. [bool:default=false]")
204 (log_display, po::value<bool>(), "Log the Display report. [bool:default=false]")
205 (log_app_mediator, po::value<bool>(), "Log the ApplicationMediator report. [bool:default=false]")
206 (log_msg_processor, po::value<bool>(), "log the MessageProcessor report")
207@@ -316,9 +318,12 @@
208 mir::DefaultServerConfiguration::the_input_manager()
209 {
210 return input_manager(
211- [&, this]()
212+ [&, this]() -> std::shared_ptr<mi::InputManager>
213 {
214- return mi::create_input_manager(the_event_filters(), the_display());
215+ if (the_options()->get("enable-input", false))
216+ return mi::create_input_manager(the_event_filters(), the_display());
217+ else
218+ return std::make_shared<mi::NullInputManager>();
219 });
220 }
221
222
223=== modified file 'src/server/input/CMakeLists.txt'
224--- src/server/input/CMakeLists.txt 2013-03-13 04:54:15 +0000
225+++ src/server/input/CMakeLists.txt 2013-04-02 21:14:24 +0000
226@@ -4,14 +4,7 @@
227 event_filter_chain.cpp
228 )
229
230-if (NOT MIR_DISABLE_INPUT)
231 add_subdirectory(android)
232-else()
233-list(
234- APPEND INPUT_SOURCES
235- dummy_input_manager.cpp
236-)
237-endif()
238
239 add_library(
240 mirinput STATIC
241
242=== removed file 'src/server/input/dummy_input_manager.cpp'
243--- src/server/input/dummy_input_manager.cpp 2013-03-29 16:51:35 +0000
244+++ src/server/input/dummy_input_manager.cpp 1970-01-01 00:00:00 +0000
245@@ -1,42 +0,0 @@
246-/*
247- * Copyright © 2012 Canonical Ltd.
248- *
249- * This program is free software: you can redistribute it and/or modify it
250- * under the terms of the GNU Lesser General Public License version 3,
251- * as published by the Free Software Foundation.
252- *
253- * This program is distributed in the hope that it will be useful,
254- * but WITHOUT ANY WARRANTY; without even the implied warranty of
255- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
256- * GNU General Public License for more details.
257- *
258- * You should have received a copy of the GNU Lesser General Public License
259- * along with this program. If not, see <http://www.gnu.org/licenses/>.
260- *
261- * Authored by: Alan Griffiths <alan@octopull.co.uk>
262- */
263-
264-#include "mir/input/input_manager.h"
265-
266-namespace mg = mir::graphics;
267-namespace mi = mir::input;
268-
269-namespace
270-{
271-class DummyInputManager : public mi::InputManager
272-{
273- void stop() {}
274- void start() {}
275- virtual std::shared_ptr<mi::InputChannel> make_input_channel() { return std::shared_ptr<mi::InputChannel>(); }
276- void set_input_focus_to(std::shared_ptr<mi::SessionTarget> const& /* session */, std::shared_ptr<mi::SurfaceTarget> const& /* surface */)
277- {
278- }
279-};
280-}
281-
282-std::shared_ptr<mi::InputManager> mi::create_input_manager(
283- const std::initializer_list<std::shared_ptr<mi::EventFilter> const>& ,
284- std::shared_ptr<mg::ViewableArea> const& )
285-{
286- return std::make_shared<DummyInputManager>();
287-}
288
289=== modified file 'tests/integration-tests/CMakeLists.txt'
290--- tests/integration-tests/CMakeLists.txt 2013-03-29 22:30:35 +0000
291+++ tests/integration-tests/CMakeLists.txt 2013-04-02 21:14:24 +0000
292@@ -12,9 +12,7 @@
293 add_subdirectory(frontend/)
294 add_subdirectory(shell/)
295 add_subdirectory(process/)
296-if (NOT MIR_DISABLE_INPUT)
297 add_subdirectory(input/)
298-endif()
299
300 if (MIR_PLATFORM STREQUAL "android")
301 include_directories(${PROJECT_SOURCE_DIR}/include/accessory)
302
303=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
304--- tests/mir_test_doubles/CMakeLists.txt 2013-03-28 09:50:09 +0000
305+++ tests/mir_test_doubles/CMakeLists.txt 2013-04-02 21:14:24 +0000
306@@ -10,12 +10,10 @@
307 event_factory.cpp
308 )
309
310-if (NOT MIR_DISABLE_INPUT)
311 list(APPEND TEST_UTILS_SRCS
312 fake_event_hub.cpp
313 fake_event_hub_input_configuration.cpp
314 )
315-endif()
316
317 list(APPEND TEST_UTILS_SRCS
318 test_protobuf_socket_server.cpp
319
320=== modified file 'tests/unit-tests/CMakeLists.txt'
321--- tests/unit-tests/CMakeLists.txt 2013-03-29 22:30:35 +0000
322+++ tests/unit-tests/CMakeLists.txt 2013-04-02 21:14:24 +0000
323@@ -11,11 +11,8 @@
324 add_subdirectory(shell/)
325 add_subdirectory(geometry/)
326 add_subdirectory(graphics/)
327-#TODO stubbed out to run tests on emulator
328-if (NOT MIR_DISABLE_INPUT)
329 add_subdirectory(input/)
330 add_subdirectory(android_input/)
331-endif()
332 add_subdirectory(surfaces/)
333 add_subdirectory(draw/)
334

Subscribers

People subscribed via source and target branches