Mir

Merge lp:~afrantzis/mir/fix-1465585-1465669-one-input-dispatcher-to-rule-them-all into lp:mir

Proposed by Alexandros Frantzis on 2015-06-16
Status: Merged
Approved by: Kevin DuBois on 2015-06-16
Approved revision: 2666
Merged at revision: 2669
Proposed branch: lp:~afrantzis/mir/fix-1465585-1465669-one-input-dispatcher-to-rule-them-all
Merge into: lp:mir
Diff against target: 30 lines (+12/-8)
1 file modified
src/server/input/default_configuration.cpp (+12/-8)
To merge this branch: bzr merge lp:~afrantzis/mir/fix-1465585-1465669-one-input-dispatcher-to-rule-them-all
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-06-16
Kevin DuBois (community) Approve on 2015-06-16
Alberto Aguirre Approve on 2015-06-16
Andreas Pokorny (community) Approve on 2015-06-16
Alan Griffiths 2015-06-16 Approve on 2015-06-16
Review via email: mp+262088@code.launchpad.net

Commit Message

input: Ensure we create and use a single InputDispatcher instance

Description of the Change

input: Ensure we create and use a single InputDispatcher instance

Previously we created multiple InputDispatcher instances and ended up confusing the rest of the display server, leading to bugs like:

https://bugs.launchpad.net/mir/+bug/1465669
https://bugs.launchpad.net/mir/+bug/1465585

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/input/default_configuration.cpp'
2--- src/server/input/default_configuration.cpp 2015-06-11 18:25:32 +0000
3+++ src/server/input/default_configuration.cpp 2015-06-16 14:01:30 +0000
4@@ -220,14 +220,18 @@
5 std::shared_ptr<mi::InputDispatcher>
6 mir::DefaultServerConfiguration::the_input_dispatcher()
7 {
8- std::chrono::milliseconds const key_repeat_timeout{20};
9-
10- auto const options = the_options();
11- auto enable_repeat = options->get<bool>(options::enable_key_repeat_opt);
12-
13- return std::make_shared<mi::KeyRepeatDispatcher>(
14- the_event_filter_chain_dispatcher(), the_main_loop(), enable_repeat,
15- key_repeat_timeout);
16+ return input_dispatcher(
17+ [this]()
18+ {
19+ std::chrono::milliseconds const key_repeat_timeout{20};
20+
21+ auto const options = the_options();
22+ auto enable_repeat = options->get<bool>(options::enable_key_repeat_opt);
23+
24+ return std::make_shared<mi::KeyRepeatDispatcher>(
25+ the_event_filter_chain_dispatcher(), the_main_loop(), enable_repeat,
26+ key_repeat_timeout);
27+ });
28 }
29
30 std::shared_ptr<droidinput::EventHubInterface>

Subscribers

People subscribed via source and target branches