After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763295 - wayland: Add gtk_surface.present to gtk-shell
wayland: Add gtk_surface.present to gtk-shell
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-03-08 09:16 UTC by Jonas Ådahl
Modified: 2016-03-10 05:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Add gtk_surface.present to gtk-shell (2.38 KB, patch)
2016-03-08 09:16 UTC, Jonas Ådahl
committed Details | Review

Description Jonas Ådahl 2016-03-08 09:16:29 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).
Comment 1 Jonas Ådahl 2016-03-08 09:16:33 UTC
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.
Comment 2 Rui Matos 2016-03-08 15:41:41 UTC
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.
Comment 3 Jonas Ådahl 2016-03-10 05:08:01 UTC
Attachment 323359 [details] pushed as f6ba3bd - wayland: Add gtk_surface.present to gtk-shell