summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-11-04 19:26:25 +0100
committerCarlos Garnacho <carlosg@gnome.org>2014-11-07 17:24:10 +0100
commitaf6eab850ebea0394d35402f4ac9eb286e9eb835 (patch)
tree4aa8ec1b5ab3ee9497bcae03c6bd845e10482350 /gdk
parent964abf74235caa5cbeab64e845c4b35ac340b860 (diff)
downloadgtk+-af6eab850ebea0394d35402f4ac9eb286e9eb835.tar.gz
wayland: Schedule a clock tick instead of wl_surface_commit()ting directly
Instead of possibly calling wl_surface_commit() out of GdkFrameClock::after-paint, tick the transient parent clock so ::after-paint can be eventually run. This ensures that the subsurface coordinates (considered part of the state of the parent) aren't committed untimely, and guaranteed to be orderly with the wl_subsurface-relative state. This is a gtk-side fix for https://bugzilla.gnome.org/show_bug.cgi?id=738887
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkwindow-wayland.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index b49dda32fe..a7e23b52d8 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1284,6 +1284,32 @@ gdk_window_wayland_restack_toplevel (GdkWindow *window,
}
static void
+gdk_window_request_transient_parent_commit (GdkWindow *window)
+{
+ GdkWindowImplWayland *window_impl, *impl;
+ GdkFrameClock *frame_clock;
+
+ window_impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+ if (!window_impl->transient_for)
+ return;
+
+ impl = GDK_WINDOW_IMPL_WAYLAND (window_impl->transient_for->impl);
+
+ if (!impl->surface || impl->pending_commit)
+ return;
+
+ frame_clock = gdk_window_get_frame_clock (window_impl->transient_for);
+
+ if (!frame_clock)
+ return;
+
+ impl->pending_commit = TRUE;
+ gdk_frame_clock_request_phase (frame_clock,
+ GDK_FRAME_CLOCK_PHASE_AFTER_PAINT);
+}
+
+static void
gdk_window_wayland_move_resize (GdkWindow *window,
gboolean with_move,
gint x,
@@ -1305,15 +1331,8 @@ gdk_window_wayland_move_resize (GdkWindow *window,
if (impl->subsurface)
{
- GdkWindowImplWayland *parent_impl;
-
wl_subsurface_set_position (impl->subsurface, x, y);
-
- g_assert (impl->transient_for != NULL);
- parent_impl = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
-
- if (parent_impl->surface && !parent_impl->pending_commit)
- wl_surface_commit (parent_impl->surface);
+ gdk_window_request_transient_parent_commit (window);
}
}
}