Mir

Merge lp:~andreas-pokorny/mir/fix-surface-information-not-propagated-to-android-input-stack into lp:mir

Proposed by Andreas Pokorny
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 1445
Proposed branch: lp:~andreas-pokorny/mir/fix-surface-information-not-propagated-to-android-input-stack
Merge into: lp:mir
Diff against target: 65 lines (+40/-0)
2 files modified
3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp (+2/-0)
tests/acceptance-tests/test_client_input.cpp (+38/-0)
To merge this branch: bzr merge lp:~andreas-pokorny/mir/fix-surface-information-not-propagated-to-android-input-stack
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Approve
Daniel van Vugt Approve
Robert Carr (community) Approve
Kevin DuBois (community) Approve
Review via email: mp+208759@code.launchpad.net

Commit message

Updates the InputWindowInfo found at InputWindowHandles everytime the InputDispatcher tries to querry the object for hit testing.

 So far that information was only updated during creation (because we triggered that in the mir implemantation) and when focus changes occur - that might be the reason why unity8 never experienced these issues. This fix kind of makes updateInfo and the interface of InputWindowInfo even more questionable. Why have those members public? Why update these only under certain circumstances..

Description of the change

This changes updates the InputWindowInfo that is provided to the android InputDispatcher for each surface and application (?) just before those objects are tested against touch positions.

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 to me

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

LGTM

review: Approve
Revision history for this message
Robert Carr (robertcarr) wrote :

+1. Your suspicion is right that WindowInfo and GetInfo is ugly. We inherited it from android input. I think in particular they used it to solve threading issues with the C++ input stack and a WindowInfo implementation on the Java side.

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

Verified bug 1268819 is fixed! However bug 1261647 is not (try the test case in the bug description). Unlinking the second bug for now...

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Blocked on bug 1287600 :(

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

> Verified bug 1268819 is fixed! However bug 1261647 is not (try the test case
> in the bug description). Unlinking the second bug for now...

ah ok, fingerpaint being fullscreen on start is a bad test subject. Will dig again.

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

bug 1287600 is fixed. top approving

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp'
2--- 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2014-01-13 06:12:33 +0000
3+++ 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2014-02-28 10:23:51 +0000
4@@ -432,6 +432,7 @@
5 sp<InputWindowHandle> InputDispatcher::findTouchedWindowAtLocked(int32_t x, int32_t y) {
6 sp<InputWindowHandle> foundHandle = NULL;
7 mEnumerator->for_each([&](sp<InputWindowHandle> windowHandle) {
8+ windowHandle->updateInfo();
9 const InputWindowInfo* windowInfo = windowHandle->getInfo();
10 int32_t flags = windowInfo->layoutParamsFlags;
11
12@@ -1151,6 +1152,7 @@
13
14 // Traverse windows from front to back to find touched window and outside targets.
15 mEnumerator->for_each([&](sp<InputWindowHandle> const& windowHandle){
16+ windowHandle->updateInfo();
17 const InputWindowInfo* windowInfo = windowHandle->getInfo();
18 int32_t flags = windowInfo->layoutParamsFlags;
19
20
21=== modified file 'tests/acceptance-tests/test_client_input.cpp'
22--- tests/acceptance-tests/test_client_input.cpp 2014-02-18 10:33:14 +0000
23+++ tests/acceptance-tests/test_client_input.cpp 2014-02-28 10:23:51 +0000
24@@ -608,3 +608,41 @@
25 launch_client_process(*client_config_1);
26 launch_client_process(*client_config_2);
27 }
28+
29+TEST_F(TestClientInput, clients_receive_motion_within_co_ordinate_system_of_window)
30+{
31+ using namespace ::testing;
32+
33+ static int const screen_width = 1000;
34+ static int const screen_height = 800;
35+ static int const client_height = screen_height/2;
36+ static int const client_width = screen_width/2;
37+ static std::string const test_client = "tc";
38+ mtf::CrossProcessSync fence;
39+
40+ static GeometryMap positions;
41+ positions[test_client] = geom::Rectangle{geom::Point{screen_width/2, screen_height/2},
42+ geom::Size{client_width, client_height}};
43+
44+ auto server_config = make_event_producing_server(fence, 1,
45+ [&](mtf::InputTestingServerConfiguration& server)
46+ {
47+ server.the_session_container()->for_each([&](std::shared_ptr<msh::Session> const& session) -> void
48+ {
49+ session->default_surface()->move_to(geom::Point{screen_width/2-40, screen_height/2-80});
50+ });
51+ server.fake_event_hub->synthesize_event(mis::a_motion_event().with_movement(screen_width/2+40, screen_height/2+90));
52+ }, positions, DepthMap());
53+ launch_server_process(*server_config);
54+
55+ auto client = make_event_expecting_client(test_client, fence,
56+ [&](MockHandler& handler, mt::WaitCondition& events_received)
57+ {
58+ InSequence seq;
59+ EXPECT_CALL(handler, handle_input(mt::HoverEnterEvent())).Times(1);
60+ EXPECT_CALL(handler, handle_input(mt::MotionEventWithPosition(80, 170))).Times(AnyNumber())
61+ .WillOnce(mt::WakeUp(&events_received));
62+ });
63+
64+ launch_client_process(*client);
65+}

Subscribers

People subscribed via source and target branches