Mir

Code review comment for lp:~andreas-pokorny/mir/use-input-channel-to-send-input

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

Kevin:
> send_event(uint32_t seq, MirEvent)
> as someone calling send_event, how do I arrange seq;
> is a particular sequence needed? Would it be better to have
> AndroidInputChannel manage the sequence if a particular ordering is required?
Alan:
> 24 + virtual void send_event(uint32_t seq, MirEvent const& event) const =
> 0;
>
> Like Kevin says: What is the significance of seq? Why do I need it to send an
> event?

I believe down - motion - up sequences of events need to have the same sequence number. So I suspect AndroidInputChannel could keep track of press / release event occurrences. The sequence number must be unique for some time, as the client has to respond using the sequence number, as a form of ACK to the server.

> ~~~~
>
> 77 +void react_to_result(droidinput::status_t result)
>
> This seems a bad name. Vis:
>
> 142 + react_to_result(publisher.publishMotionEvent(seq, ...));
>
> "check_result" is slightly better, "check" possibly better still.

ack

> ~~~~
>
> 90 + channel = new droidinput::InputChannel(droidinput::String8("TODO:
> Name"), s_fd);
>
> "TODO: Name" is a distracting choice. What is going on here?

just moved the code - I believe we could use the surface name here instead. fixing that.

« Back to merge proposal