[gtk/wip/matthiasc/popup5: 109/120] gdk: Inherit the frame clock for popups
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup5: 109/120] gdk: Inherit the frame clock for popups
- Date: Sun, 19 May 2019 20:28:09 +0000 (UTC)
commit 00f14b2ac2161ffc76c2cc967f277c3f48906715
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 5 22:59:51 2019 +0000
gdk: Inherit the frame clock for popups
With separate clocks, the phases are not coordinated,
which messes with GTKs size allocation machinery treating
the entire widget tree as a whole, and causes us to
run into assertion where popups get drawn before they
are allocated.
gdk/wayland/gdksurface-wayland.c | 5 ++++-
gdk/x11/gdksurface-x11.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 727ce0b638..88989496a4 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -510,7 +510,10 @@ _gdk_wayland_display_create_surface (GdkDisplay *display,
GdkWaylandSurface *impl;
GdkFrameClock *frame_clock;
- frame_clock = _gdk_frame_clock_idle_new ();
+ if (parent)
+ frame_clock = g_object_ref (gdk_surface_get_frame_clock (parent));
+ else
+ frame_clock = _gdk_frame_clock_idle_new ();
surface = g_object_new (GDK_TYPE_WAYLAND_SURFACE,
"display", display,
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 1d6dee093a..c4887c0fbc 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -809,7 +809,10 @@ _gdk_x11_display_create_surface (GdkDisplay *display,
x11_screen = GDK_X11_SCREEN (display_x11->screen);
xparent = GDK_SCREEN_XROOTWIN (x11_screen);
- frame_clock = _gdk_frame_clock_idle_new ();
+ if (parent)
+ frame_clock = g_object_ref (gdk_surface_get_frame_clock (parent));
+ else
+ frame_clock = _gdk_frame_clock_idle_new ();
surface = g_object_new (GDK_TYPE_X11_SURFACE,
"display", display,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]