Mir

Merge lp:~robertcarr/mir/fix-disabled-input into lp:~mir-team/mir/trunk

Proposed by Robert Carr
Status: Merged
Approved by: Chris Halse Rogers
Approved revision: no longer in the source branch.
Merged at revision: 596
Proposed branch: lp:~robertcarr/mir/fix-disabled-input
Merge into: lp:~mir-team/mir/trunk
Diff against target: 78 lines (+54/-2)
2 files modified
include/server/mir/input/null_input_focus_selector.h (+48/-0)
src/server/default_server_configuration.cpp (+6/-2)
To merge this branch: bzr merge lp:~robertcarr/mir/fix-disabled-input
Reviewer Review Type Date Requested Status
Chris Halse Rogers Approve
Robert Ancell Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+159277@code.launchpad.net

Commit message

Fix disabled input.

Description of the change

Fix disabled input.

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
Robert Ancell (robert-ancell) wrote :

Looks right

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

Looks right, fixes the bug.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'include/server/mir/input/null_input_focus_selector.h'
2--- include/server/mir/input/null_input_focus_selector.h 1970-01-01 00:00:00 +0000
3+++ include/server/mir/input/null_input_focus_selector.h 2013-04-17 02:05:30 +0000
4@@ -0,0 +1,48 @@
5+/*
6+ * Copyright © 2013 Canonical Ltd.
7+ *
8+ * This program is free software: you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License version 3,
10+ * as published by the Free Software Foundation.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU General Public License
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19+ *
20+ * Authored by: Robert Carr <robert.carr@canonical.com>
21+ */
22+
23+#ifndef MIR_INPUT_NULL_INPUT_FOCUS_SELECTOR_H_
24+#define MIR_INPUT_NULL_INPUT_FOCUS_SELECTOR_H_
25+
26+#include "mir/shell/input_focus_selector.h"
27+
28+namespace mir
29+{
30+namespace input
31+{
32+
33+class NullInputFocusSelector : public shell::InputFocusSelector
34+{
35+public:
36+ NullInputFocusSelector() {};
37+ virtual ~NullInputFocusSelector() {}
38+
39+ virtual void set_input_focus_to(std::shared_ptr<input::SessionTarget> const&,
40+ std::shared_ptr<input::SurfaceTarget> const&)
41+ {
42+ }
43+
44+protected:
45+ NullInputFocusSelector(const NullInputFocusSelector&) = delete;
46+ NullInputFocusSelector& operator=(const NullInputFocusSelector&) = delete;
47+};
48+
49+}
50+}
51+
52+#endif // MIR_INPUT_NULL_INPUT_FOCUS_SELECTOR_H_
53
54=== modified file 'src/server/default_server_configuration.cpp'
55--- src/server/default_server_configuration.cpp 2013-04-17 01:08:27 +0000
56+++ src/server/default_server_configuration.cpp 2013-04-17 02:05:30 +0000
57@@ -45,6 +45,7 @@
58 #include "mir/graphics/buffer_initializer.h"
59 #include "mir/graphics/null_display_report.h"
60 #include "mir/input/null_input_manager.h"
61+#include "mir/input/null_input_focus_selector.h"
62 #include "input/android/default_android_input_configuration.h"
63 #include "input/android/android_input_manager.h"
64 #include "input/android/android_dispatcher_controller.h"
65@@ -520,9 +521,12 @@
66 std::shared_ptr<msh::InputFocusSelector> mir::DefaultServerConfiguration::the_input_focus_selector()
67 {
68 return input_focus_selector(
69- [&]()
70+ [&]() -> std::shared_ptr<msh::InputFocusSelector>
71 {
72- return std::make_shared<mia::DispatcherController>(the_input_configuration());
73+ if (the_options()->get("enable-input", false))
74+ return std::make_shared<mia::DispatcherController>(the_input_configuration());
75+ else
76+ return std::make_shared<mi::NullInputFocusSelector>();
77 });
78 }
79

Subscribers

People subscribed via source and target branches