<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 6, 2016 at 3:32 AM, Daniel Stone <span dir="ltr"><<a href="mailto:daniel@fooishbar.org" target="_blank">daniel@fooishbar.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
On 5 December 2016 at 03:36, Dima Ryazanov <<a href="mailto:dima@gmail.com">dima@gmail.com</a>> wrote:<br>
> (This is kind of a workaround, but perhaps the right thing to do anyways.)<br>
><br>
> The menu implementation in window.c needs to know the time of the event that<br>
> triggered the menu - however, the xdg-shell's show_window_menu API does not<br>
> give us that info. There doesn't seem to be an easy way to fake it because<br>
> different compositors use different times when sending events:<br>
> - compositor-drm uses the monotonic clock<br>
> - compositor-x11 uses weston_compositor_get_time<br>
> - compositor-wayland uses the event times in got from the parent compositor<br>
> - GNOME appears to use the monotonic clock<br>
><br>
> Switching weston_compositor_get_time to use the monotonic clock works around<br>
> this issue - though things would break in compositor-wayland if its parent<br>
> uses something else.<br>
><br>
> Signed-off-by: Dima Ryazanov <<a href="mailto:dima@gmail.com">dima@gmail.com</a>><br>
<br>
</span>I think we may want a check that CLOCK_MONOTONIC actually works (i.e.<br>
the first time this function is called, assert that ret == 0). But<br>
yes, it's definitely the right thing to do, so with that:<br>
Reviewed-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br></blockquote><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Cheers,<br>
Daniel<br>
</blockquote></div><br></div></div>