On Tue, Dec 6, 2016 at 3:32 AM, Daniel Stone <dan...@fooishbar.org> wrote:

> Hi,
>
> On 5 December 2016 at 03:36, Dima Ryazanov <d...@gmail.com> wrote:
> > (This is kind of a workaround, but perhaps the right thing to do
> anyways.)
> >
> > The menu implementation in window.c needs to know the time of the event
> that
> > triggered the menu - however, the xdg-shell's show_window_menu API does
> not
> > give us that info. There doesn't seem to be an easy way to fake it
> because
> > different compositors use different times when sending events:
> > - compositor-drm uses the monotonic clock
> > - compositor-x11 uses weston_compositor_get_time
> > - compositor-wayland uses the event times in got from the parent
> compositor
> > - GNOME appears to use the monotonic clock
> >
> > Switching weston_compositor_get_time to use the monotonic clock works
> around
> > this issue - though things would break in compositor-wayland if its
> parent
> > uses something else.
> >
> > Signed-off-by: Dima Ryazanov <d...@gmail.com>
>
> I think we may want a check that CLOCK_MONOTONIC actually works (i.e.
> the first time this function is called, assert that ret == 0). But
> yes, it's definitely the right thing to do, so with that:
> Reviewed-by: Daniel Stone <dani...@collabora.com>
>

If we're going to assert, do you think it's ok to just assert every time?
That would make the logic simpler - and it doesn't look like it could
succeed once, then fail later.

Though almost all of the existing code just ignores the return value. It
would be good to either handle failures everywhere, or just assert that the
clock works when Weston starts up.

Cheers,
> Daniel
>
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to