GNOME Bugzilla – Bug 763295
wayland: Add gtk_surface.present to gtk-shell
Last modified: 2016-03-10 05:08:04 UTC
This makes it possible to implement gtk_window_present. It currently uses timestamps in the same way as _NET_ACTIVE_WINDOW, mostly because that is what is needed to implement the Gtk API. When we add something similar to xdg_* that might not still be the case, but we can deal with that later (probably mostly deal with GTK+ API deprecation and such).
Created attachment 323359 [details] [review] wayland: Add gtk_surface.present to gtk-shell This commits adds a gtk_surface.present request and its implementation. The timestamp is assumed to be from some input event that the client responded to. The timestamps we deal with when managing windows will usually come from two different clocks: CLOCK_MONOTONIC if they come from libinput/evdev, or CLOCK_MONOTONIC_COARSE if they come from the X server. Luckily these are quite similar, the difference beeing that the X server timestamps having lower resolution, so we can just pass the timestamps no matter where they came from and it'll most likely work fine, except for the race condition described in bug 756272 which might happen here too until it is properly fixed.
Review of attachment 323359 [details] [review]: Ok with the fix below ::: src/wayland/meta-wayland-surface.c @@ +2032,3 @@ + return; + + meta_window_activate (window, timestamp); This should be meta_window_activate_full (window, timestamp, META_CLIENT_TYPE_APPLICATION, NULL); since the request comes from an application. It doesn't matter much since by default we have raise-on-click enabled and this is ignored but if that option is false then we shouldn't raise the window.
Attachment 323359 [details] pushed as f6ba3bd - wayland: Add gtk_surface.present to gtk-shell