Mir

Merge lp://qastaging/~alan-griffiths/mir/spike-nested-input into lp://qastaging/~mir-team/mir/trunk

Proposed by Alan Griffiths
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 1059
Proposed branch: lp://qastaging/~alan-griffiths/mir/spike-nested-input
Merge into: lp://qastaging/~mir-team/mir/trunk
Prerequisite: lp://qastaging/~alan-griffiths/mir/spike-more-nested-input
Diff against target: 612 lines (+285/-59)
13 files modified
include/server/mir/default_server_configuration.h (+3/-0)
include/server/mir/graphics/nested/nested_platform.h (+7/-3)
include/server/mir/input/nested_input_configuration.h (+5/-18)
include/server/mir/input/nested_input_relay.h (+49/-0)
src/server/default_server_configuration.cpp (+13/-2)
src/server/graphics/nested/nested_display.cpp (+10/-2)
src/server/graphics/nested/nested_display.h (+3/-0)
src/server/graphics/nested/nested_output.cpp (+38/-1)
src/server/graphics/nested/nested_output.h (+7/-3)
src/server/graphics/nested/nested_platform.cpp (+3/-1)
src/server/input/CMakeLists.txt (+1/-0)
src/server/input/nested_input_configuration.cpp (+4/-29)
src/server/input/nested_input_relay.cpp (+142/-0)
To merge this branch: bzr merge lp://qastaging/~alan-griffiths/mir/spike-nested-input
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alexandros Frantzis (community) Approve
Kevin DuBois (community) Approve
Review via email: mp+184351@code.qastaging.launchpad.net

Commit message

graphics: Hook up nested surfaces events to input

Description of the change

graphics: Hook up nested surfaces events to input

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

291 + std::shared_ptr<input::EventFilter> const& event_handler) :
event_filter vs. event_handler (pre-existing, and is common naming problem in the code elsewhere)

517 + // TODO can reviewers look carefully at these?
my best guess is security reasons, although i'm not very sure either

all in all, looks good

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

1. I'm concerned about this:
337 + case mir_event_type_surface:
338 + // TODO Surface attributes shouldn't be changing. So what do we do if they do?
339 + break;
Not sure of the context though. Seems strange and dangerous to drop a whole family of event types. And if it's only that we want to translate motion events, why do we handle mir_event_type_key still?

2. mi::NestedInputRelay::handle() has a scary degree of coupling. Can we not copy the event data more atomically?

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

> 2. mi::NestedInputRelay::handle() has a scary degree of coupling. Can we not
> copy the event data more atomically?

I wish! The types we adopted from the android input stack are difficult to work with (there's similar code doing the converse transformation) - hopefully we can do some refactoring once we are feature complete.

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

524 + static auto const policy_flags = ::android::POLICY_FLAG_INJECTED || ::android::POLICY_FLAG_TRUSTED;

We should be using bitwise OR (|).

::android::POLICY_FLAG_INJECTED is automatically added by injectInputEvent(), so there is no need to add it.

::android::POLICY_FLAG_TRUSTED is also added by injectInputEvent() because uid == 0, but I guess it's better to be explicit about it.

I am not sure if we also need to use ::android::POLICY_FLAG_PASS_TO_USER.

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

> 524 + static auto const policy_flags = ::android::POLICY_FLAG_INJECTED ||
> ::android::POLICY_FLAG_TRUSTED;
>
> We should be using bitwise OR (|).

Good catch, thanks!

> I am not sure if we also need to use ::android::POLICY_FLAG_PASS_TO_USER.

I think that is correctly done by mia::EventFilterDispatcherPolicy

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Top approving.

This code can't be tested on GBM at the moment. (We end up crashing egl when we try for a nested configuration - Alexandros is working on it.)

On android, it doesn't work (but doesn't crash). I'm continuing to work on this.

But I think the code is better off living on trunk while these problems are resolved.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches