GNOME Bugzilla – Bug 786455
[PATCH] gdk/wayland: allow focusing without a specific timestamp
Last modified: 2017-08-23 15:03:29 UTC
Created attachment 357872 [details] [review] 0001-gdk-wayland-allow-focusing-without-a-specific-timest.patch gtk_get_current_event_time() could return timestamp == GDK_CURRENT_TIME, which should be handled instead of being simply discarded.
this patch doesn't really 'handle' it in any way though, and just passes it through, ignoring the comment that it removes
(In reply to Matthias Clasen from comment #1) > this patch doesn't really 'handle' it in any way though, and just passes it > through, ignoring the comment that it removes It's handled in mutter: https://git.gnome.org/browse/mutter/tree/src/core/window.c#n3395 Also please look at this commit: [window: Treat CurrentTime as legal timestamp in activation] https://git.gnome.org/browse/mutter/commit/?id=5defe574d74eace55bfe9e7e79ffaaa40f50372f So IMHO it's safe to consider GDK_CURRENT_TIME valid and just pass it through.
that does not do any of the things outlined in the gdk comment, afaics
(In reply to Xiang Fan from comment #2) > (In reply to Matthias Clasen from comment #1) > > this patch doesn't really 'handle' it in any way though, and just passes it > > through, ignoring the comment that it removes > > It's handled in mutter: > https://git.gnome.org/browse/mutter/tree/src/core/window.c#n3395 > > Also please look at this commit: > [window: Treat CurrentTime as legal timestamp in activation] > https://git.gnome.org/browse/mutter/commit/ > ?id=5defe574d74eace55bfe9e7e79ffaaa40f50372f > > So IMHO it's safe to consider GDK_CURRENT_TIME valid and just pass it > through. I'd like to point out that mutter figuring out a decent timestamp for the request does not mean that passing GDK_CURRENT_TIME is correct, nor desirable according to the semantics of a "present" request. What would happen here is that the request gets the timestamp at the time Mutter is processing the request, not the time of the input event that triggered the window to be shown. The latter is useful to Mutter to determine whether there was further activity after the present request, the former is a randomly recent timestamp that will beat anything else, and pretty much defeats the purpose of a timestamp in the "present" request.
So, as far as I can see inside gtkwindow.c we ask the X11 backend for a "user timestamp", which iirc is just the timestamp of the last event received, regardless of the type of event. Is that something the wayland backend should fall back to for GDK_CURRENT_TIME as well? Should it be backend agnostic?
(In reply to Carlos Garnacho from comment #4) > I'd like to point out that mutter figuring out a decent timestamp for the > request does not mean that passing GDK_CURRENT_TIME is correct, nor > desirable according to the semantics of a "present" request. > > What would happen here is that the request gets the timestamp at the time > Mutter is processing the request, not the time of the input event that > triggered the window to be shown. The latter is useful to Mutter to > determine whether there was further activity after the present request, the > former is a randomly recent timestamp that will beat anything else, and > pretty much defeats the purpose of a timestamp in the "present" request. If the event comes from an external source not known to Wayland (e.g. type gedit in terminal when a gedit window is already open) the client can't figure out the timestamp anyway. How do we handle this?
Pretty sure this bug is a duplicate of bug #766284, right? *** This bug has been marked as a duplicate of bug 766284 ***