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
=== modified file '3rd_party/CMakeLists.txt'
--- 3rd_party/CMakeLists.txt 2013-03-21 03:32:59 +0000
+++ 3rd_party/CMakeLists.txt 2013-04-02 21:14:24 +0000
@@ -28,10 +28,8 @@
28 add_subdirectory(android-fbtype)28 add_subdirectory(android-fbtype)
29endif()29endif()
3030
31if (NOT MIR_DISABLE_INPUT)31include_directories(${CMAKE_CURRENT_SOURCE_DIR}/android-deps)
32 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/android-deps)32add_subdirectory(android-input)
33 add_subdirectory(android-input)
34endif()
3533
36set(MIR_ANDROID_INCLUDE_DIRECTORIES ${MIR_ANDROID_INCLUDE_DIRECTORIES} PARENT_SCOPE)34set(MIR_ANDROID_INCLUDE_DIRECTORIES ${MIR_ANDROID_INCLUDE_DIRECTORIES} PARENT_SCOPE)
37set(35set(
@@ -39,9 +37,7 @@
39 ${MIR_ANDROID_INPUT_COMPILE_FLAGS}37 ${MIR_ANDROID_INPUT_COMPILE_FLAGS}
40 PARENT_SCOPE)38 PARENT_SCOPE)
41 39
42if (NOT MIR_DISABLE_INPUT)
43target_link_libraries(40target_link_libraries(
44 3rd_party41 3rd_party
4542
46 android-input)43 android-input)
47endif()
4844
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-03-28 14:20:06 +0000
+++ CMakeLists.txt 2013-04-02 21:14:24 +0000
@@ -103,13 +103,6 @@
103 "graphics backend to build (options are 'gbm' or 'android')"103 "graphics backend to build (options are 'gbm' or 'android')"
104)104)
105105
106set (MIR_DISABLE_INPUT
107 false
108 CACHE
109 BOOL
110 "Don't build the input subsystem"
111)
112
113set (MIR_INPUT_USE_ANDROID_TYPES106set (MIR_INPUT_USE_ANDROID_TYPES
114 false107 false
115 CACHE108 CACHE
116109
=== modified file 'cross-compile-chroot.sh'
--- cross-compile-chroot.sh 2013-03-26 15:55:51 +0000
+++ cross-compile-chroot.sh 2013-04-02 21:14:24 +0000
@@ -26,7 +26,6 @@
26 -DBoost_COMPILER=-gcc \26 -DBoost_COMPILER=-gcc \
27 -DMIR_ENABLE_DEATH_TESTS=NO \27 -DMIR_ENABLE_DEATH_TESTS=NO \
28 -DMIR_PLATFORM=android \28 -DMIR_PLATFORM=android \
29 -DMIR_DISABLE_INPUT=true \
30 .. 29 ..
3130
32 cmake --build .31 cmake --build .
3332
=== modified file 'debian/rules'
--- debian/rules 2013-03-13 04:54:15 +0000
+++ debian/rules 2013-04-02 21:14:24 +0000
@@ -15,7 +15,6 @@
1515
16COMMON_CONFIGURE_OPTIONS = \16COMMON_CONFIGURE_OPTIONS = \
17 -DMIR_DISABLE_EPOLL_REACTOR=YES \17 -DMIR_DISABLE_EPOLL_REACTOR=YES \
18 -DMIR_DISABLE_INPUT=YES \
19 -DBUILD_DOXYGEN=YES18 -DBUILD_DOXYGEN=YES
2019
21# We need to rely on the select-based reactor to fix the ppa builds.20# We need to rely on the select-based reactor to fix the ppa builds.
2221
=== modified file 'doc/building_source_for_android.md'
--- doc/building_source_for_android.md 2013-03-26 16:30:53 +0000
+++ doc/building_source_for_android.md 2013-04-02 21:14:24 +0000
@@ -42,7 +42,7 @@
4242
43 $ bzr branch lp:mir43 $ bzr branch lp:mir
44 $ mkdir mir/build; cd mir/build44 $ mkdir mir/build; cd mir/build
45 $ cmake -DBoost_COMPILER=-gcc -DMIR_ENABLE_DEATH_TESTS=NO -DMIR_PLATFORM=android -DMIR_DISABLE_INPUT=yes ..45 $ cmake -DBoost_COMPILER=-gcc -DMIR_ENABLE_DEATH_TESTS=NO -DMIR_PLATFORM=android ..
4646
47Cross Compile47Cross Compile
48-------------48-------------
@@ -63,7 +63,7 @@
6363
64 $ bzr branch lp:mir64 $ bzr branch lp:mir
65 $ mkdir mir/build; cd mir/build65 $ mkdir mir/build; cd mir/build
66 $ 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 ..66 $ 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 ..
67 $ make67 $ make
6868
69N.B. The `cross-compile-android.sh` script in mir's top level directory69N.B. The `cross-compile-android.sh` script in mir's top level directory
7070
=== modified file 'examples/render_surfaces.cpp'
--- examples/render_surfaces.cpp 2013-04-02 09:36:09 +0000
+++ examples/render_surfaces.cpp 2013-04-02 21:14:24 +0000
@@ -23,7 +23,7 @@
23#include "mir/geometry/size.h"23#include "mir/geometry/size.h"
24#include "mir/graphics/buffer_initializer.h"24#include "mir/graphics/buffer_initializer.h"
25#include "mir/graphics/display.h"25#include "mir/graphics/display.h"
26#include "mir/input/input_manager.h"26#include "mir/input/null_input_manager.h"
27#include "mir/shell/surface_builder.h"27#include "mir/shell/surface_builder.h"
28#include "mir/surfaces/surface.h"28#include "mir/surfaces/surface.h"
29#include "mir/default_server_configuration.h"29#include "mir/default_server_configuration.h"
@@ -380,20 +380,6 @@
380// Stub out input.380// Stub out input.
381std::shared_ptr<mi::InputManager> RenderSurfacesServerConfiguration::the_input_manager()381std::shared_ptr<mi::InputManager> RenderSurfacesServerConfiguration::the_input_manager()
382{382{
383 struct NullInputManager : public mi::InputManager383 return std::make_shared<mi::NullInputManager>();
384 {
385 void start() {}
386 void stop() {}
387 std::shared_ptr<mi::InputChannel> make_input_channel()
388 {
389 return std::shared_ptr<mi::InputChannel>();
390 }
391 void set_input_focus_to(std::shared_ptr<mi::SessionTarget> const& /* session */,
392 std::shared_ptr<mi::SurfaceTarget> const& /* surface */)
393 {
394 }
395 };
396
397 return std::make_shared<NullInputManager>();
398}384}
399///\internal [NullInputManager_tag]385///\internal [NullInputManager_tag]
400386
=== added file 'include/server/mir/input/null_input_manager.h'
--- include/server/mir/input/null_input_manager.h 1970-01-01 00:00:00 +0000
+++ include/server/mir/input/null_input_manager.h 2013-04-02 21:14:24 +0000
@@ -0,0 +1,56 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */
18
19#ifndef MIR_INPUT_NULL_INPUT_MANAGER_H_
20#define MIR_INPUT_NULL_INPUT_MANAGER_H_
21
22#include "mir/input/input_manager.h"
23
24namespace mir
25{
26namespace input
27{
28
29class NullInputManager : public InputManager
30{
31public:
32 NullInputManager() {};
33 virtual ~NullInputManager() {}
34
35 void start() {}
36 void stop() {}
37
38 std::shared_ptr<InputChannel> make_input_channel()
39 {
40 return std::shared_ptr<InputChannel>();
41 }
42
43 virtual void set_input_focus_to(std::shared_ptr<input::SessionTarget> const& /* session */,
44 std::shared_ptr<input::SurfaceTarget> const& /* surface */)
45 {
46 }
47
48protected:
49 NullInputManager(const NullInputManager&) = delete;
50 NullInputManager& operator=(const NullInputManager&) = delete;
51};
52
53}
54}
55
56#endif // MIR_INPUT_NULL_INPUT_MANAGER
057
=== modified file 'src/server/default_server_configuration.cpp'
--- src/server/default_server_configuration.cpp 2013-03-28 14:20:06 +0000
+++ src/server/default_server_configuration.cpp 2013-04-02 21:14:24 +0000
@@ -44,6 +44,7 @@
44#include "mir/graphics/buffer_initializer.h"44#include "mir/graphics/buffer_initializer.h"
45#include "mir/graphics/null_display_report.h"45#include "mir/graphics/null_display_report.h"
46#include "mir/input/input_manager.h"46#include "mir/input/input_manager.h"
47#include "mir/input/null_input_manager.h"
47#include "mir/logging/logger.h"48#include "mir/logging/logger.h"
48#include "mir/logging/dumb_console_logger.h"49#include "mir/logging/dumb_console_logger.h"
49#include "mir/logging/glog_logger.h"50#include "mir/logging/glog_logger.h"
@@ -140,6 +141,7 @@
140 "Environment variables capitalise long form with prefix \"MIR_SERVER_\" and \"_\" in place of \"-\"");141 "Environment variables capitalise long form with prefix \"MIR_SERVER_\" and \"_\" in place of \"-\"");
141 desc.add_options()142 desc.add_options()
142 ("file,f", po::value<std::string>(), "Socket filename")143 ("file,f", po::value<std::string>(), "Socket filename")
144 ("enable-input,i", po::value<bool>(), "Enable input. [bool:default=false]")
143 (log_display, po::value<bool>(), "Log the Display report. [bool:default=false]")145 (log_display, po::value<bool>(), "Log the Display report. [bool:default=false]")
144 (log_app_mediator, po::value<bool>(), "Log the ApplicationMediator report. [bool:default=false]")146 (log_app_mediator, po::value<bool>(), "Log the ApplicationMediator report. [bool:default=false]")
145 (log_msg_processor, po::value<bool>(), "log the MessageProcessor report")147 (log_msg_processor, po::value<bool>(), "log the MessageProcessor report")
@@ -316,9 +318,12 @@
316mir::DefaultServerConfiguration::the_input_manager()318mir::DefaultServerConfiguration::the_input_manager()
317{319{
318 return input_manager(320 return input_manager(
319 [&, this]()321 [&, this]() -> std::shared_ptr<mi::InputManager>
320 {322 {
321 return mi::create_input_manager(the_event_filters(), the_display());323 if (the_options()->get("enable-input", false))
324 return mi::create_input_manager(the_event_filters(), the_display());
325 else
326 return std::make_shared<mi::NullInputManager>();
322 });327 });
323}328}
324329
325330
=== modified file 'src/server/input/CMakeLists.txt'
--- src/server/input/CMakeLists.txt 2013-03-13 04:54:15 +0000
+++ src/server/input/CMakeLists.txt 2013-04-02 21:14:24 +0000
@@ -4,14 +4,7 @@
4 event_filter_chain.cpp4 event_filter_chain.cpp
5)5)
66
7if (NOT MIR_DISABLE_INPUT)
8add_subdirectory(android)7add_subdirectory(android)
9else()
10list(
11 APPEND INPUT_SOURCES
12 dummy_input_manager.cpp
13)
14endif()
158
16add_library(9add_library(
17 mirinput STATIC10 mirinput STATIC
1811
=== removed file 'src/server/input/dummy_input_manager.cpp'
--- src/server/input/dummy_input_manager.cpp 2013-03-29 16:51:35 +0000
+++ src/server/input/dummy_input_manager.cpp 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1/*
2 * Copyright © 2012 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#include "mir/input/input_manager.h"
20
21namespace mg = mir::graphics;
22namespace mi = mir::input;
23
24namespace
25{
26class DummyInputManager : public mi::InputManager
27{
28 void stop() {}
29 void start() {}
30 virtual std::shared_ptr<mi::InputChannel> make_input_channel() { return std::shared_ptr<mi::InputChannel>(); }
31 void set_input_focus_to(std::shared_ptr<mi::SessionTarget> const& /* session */, std::shared_ptr<mi::SurfaceTarget> const& /* surface */)
32 {
33 }
34};
35}
36
37std::shared_ptr<mi::InputManager> mi::create_input_manager(
38 const std::initializer_list<std::shared_ptr<mi::EventFilter> const>& ,
39 std::shared_ptr<mg::ViewableArea> const& )
40{
41 return std::make_shared<DummyInputManager>();
42}
430
=== modified file 'tests/integration-tests/CMakeLists.txt'
--- tests/integration-tests/CMakeLists.txt 2013-03-29 22:30:35 +0000
+++ tests/integration-tests/CMakeLists.txt 2013-04-02 21:14:24 +0000
@@ -12,9 +12,7 @@
12add_subdirectory(frontend/)12add_subdirectory(frontend/)
13add_subdirectory(shell/)13add_subdirectory(shell/)
14add_subdirectory(process/)14add_subdirectory(process/)
15if (NOT MIR_DISABLE_INPUT)
16add_subdirectory(input/)15add_subdirectory(input/)
17endif()
1816
19if (MIR_PLATFORM STREQUAL "android")17if (MIR_PLATFORM STREQUAL "android")
20 include_directories(${PROJECT_SOURCE_DIR}/include/accessory)18 include_directories(${PROJECT_SOURCE_DIR}/include/accessory)
2119
=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
--- tests/mir_test_doubles/CMakeLists.txt 2013-03-28 09:50:09 +0000
+++ tests/mir_test_doubles/CMakeLists.txt 2013-04-02 21:14:24 +0000
@@ -10,12 +10,10 @@
10 event_factory.cpp10 event_factory.cpp
11)11)
1212
13if (NOT MIR_DISABLE_INPUT)
14list(APPEND TEST_UTILS_SRCS13list(APPEND TEST_UTILS_SRCS
15 fake_event_hub.cpp14 fake_event_hub.cpp
16 fake_event_hub_input_configuration.cpp15 fake_event_hub_input_configuration.cpp
17)16)
18endif()
1917
20list(APPEND TEST_UTILS_SRCS18list(APPEND TEST_UTILS_SRCS
21 test_protobuf_socket_server.cpp19 test_protobuf_socket_server.cpp
2220
=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt 2013-03-29 22:30:35 +0000
+++ tests/unit-tests/CMakeLists.txt 2013-04-02 21:14:24 +0000
@@ -11,11 +11,8 @@
11add_subdirectory(shell/)11add_subdirectory(shell/)
12add_subdirectory(geometry/)12add_subdirectory(geometry/)
13add_subdirectory(graphics/)13add_subdirectory(graphics/)
14#TODO stubbed out to run tests on emulator
15if (NOT MIR_DISABLE_INPUT)
16add_subdirectory(input/)14add_subdirectory(input/)
17add_subdirectory(android_input/)15add_subdirectory(android_input/)
18endif()
19add_subdirectory(surfaces/)16add_subdirectory(surfaces/)
20add_subdirectory(draw/)17add_subdirectory(draw/)
2118

Subscribers

People subscribed via source and target branches