Mir

Code review comment for lp:~alan-griffiths/mir/event-timestamps

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

> *Discussion Needed*
> The input_event 'method name' is mir_input_event_get_time. The derived
> structures do not use '_get_' for getters. But why not stick with time instead
> of timestamp? That would mean 'mir_keyboard_event_time'.
>
> Libinput has a similar thing with base and specific events and there the
> solution is to provide a libinput_{specific_event}_get_base_event function.

I considered that, but felt the code I wanted to write (in qtmir) would be clearer with this approach.

Vis:

    auto const timestamp = mir_keyboard_event_timestamp(kev);

as opposed to:

    auto const input_event = mir_keyboard_event_get_base_event(kev);
    auto const timestamp = mir_input_event_get_time(input_event);

or, more consistently:

    auto const input_event = mir_keyboard_event_input_event(kev);
    auto const timestamp = mir_input_event_get_time(input_event);

But as Alexandros mentions this suggestion would avoid writing 3*n (trivially different) functions where 3 would suffice.

In any case I have a mild preference for this approach but will conform to the majority view.

« Back to merge proposal