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
=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp'
--- 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2014-01-13 06:12:33 +0000
+++ 3rd_party/android-input/android/frameworks/base/services/input/InputDispatcher.cpp 2014-02-28 10:23:51 +0000
@@ -432,6 +432,7 @@
432sp<InputWindowHandle> InputDispatcher::findTouchedWindowAtLocked(int32_t x, int32_t y) {432sp<InputWindowHandle> InputDispatcher::findTouchedWindowAtLocked(int32_t x, int32_t y) {
433 sp<InputWindowHandle> foundHandle = NULL;433 sp<InputWindowHandle> foundHandle = NULL;
434 mEnumerator->for_each([&](sp<InputWindowHandle> windowHandle) {434 mEnumerator->for_each([&](sp<InputWindowHandle> windowHandle) {
435 windowHandle->updateInfo();
435 const InputWindowInfo* windowInfo = windowHandle->getInfo();436 const InputWindowInfo* windowInfo = windowHandle->getInfo();
436 int32_t flags = windowInfo->layoutParamsFlags;437 int32_t flags = windowInfo->layoutParamsFlags;
437438
@@ -1151,6 +1152,7 @@
11511152
1152 // Traverse windows from front to back to find touched window and outside targets.1153 // Traverse windows from front to back to find touched window and outside targets.
1153 mEnumerator->for_each([&](sp<InputWindowHandle> const& windowHandle){1154 mEnumerator->for_each([&](sp<InputWindowHandle> const& windowHandle){
1155 windowHandle->updateInfo();
1154 const InputWindowInfo* windowInfo = windowHandle->getInfo();1156 const InputWindowInfo* windowInfo = windowHandle->getInfo();
1155 int32_t flags = windowInfo->layoutParamsFlags;1157 int32_t flags = windowInfo->layoutParamsFlags;
11561158
11571159
=== modified file 'tests/acceptance-tests/test_client_input.cpp'
--- tests/acceptance-tests/test_client_input.cpp 2014-02-18 10:33:14 +0000
+++ tests/acceptance-tests/test_client_input.cpp 2014-02-28 10:23:51 +0000
@@ -608,3 +608,41 @@
608 launch_client_process(*client_config_1);608 launch_client_process(*client_config_1);
609 launch_client_process(*client_config_2);609 launch_client_process(*client_config_2);
610}610}
611
612TEST_F(TestClientInput, clients_receive_motion_within_co_ordinate_system_of_window)
613{
614 using namespace ::testing;
615
616 static int const screen_width = 1000;
617 static int const screen_height = 800;
618 static int const client_height = screen_height/2;
619 static int const client_width = screen_width/2;
620 static std::string const test_client = "tc";
621 mtf::CrossProcessSync fence;
622
623 static GeometryMap positions;
624 positions[test_client] = geom::Rectangle{geom::Point{screen_width/2, screen_height/2},
625 geom::Size{client_width, client_height}};
626
627 auto server_config = make_event_producing_server(fence, 1,
628 [&](mtf::InputTestingServerConfiguration& server)
629 {
630 server.the_session_container()->for_each([&](std::shared_ptr<msh::Session> const& session) -> void
631 {
632 session->default_surface()->move_to(geom::Point{screen_width/2-40, screen_height/2-80});
633 });
634 server.fake_event_hub->synthesize_event(mis::a_motion_event().with_movement(screen_width/2+40, screen_height/2+90));
635 }, positions, DepthMap());
636 launch_server_process(*server_config);
637
638 auto client = make_event_expecting_client(test_client, fence,
639 [&](MockHandler& handler, mt::WaitCondition& events_received)
640 {
641 InSequence seq;
642 EXPECT_CALL(handler, handle_input(mt::HoverEnterEvent())).Times(1);
643 EXPECT_CALL(handler, handle_input(mt::MotionEventWithPosition(80, 170))).Times(AnyNumber())
644 .WillOnce(mt::WakeUp(&events_received));
645 });
646
647 launch_client_process(*client);
648}

Subscribers

People subscribed via source and target branches