r51898 - in /desktop/unstable/gtk+3.0/debian: changelog patches/series patches/wayland-Disable-EGL-swap-interval.patch patches/wayland-Handle-subsurface-as-popup-parent.patch

sjoerd at users.alioth.debian.org sjoerd at users.alioth.debian.org
Wed Jan 11 22:01:23 UTC 2017


Author: sjoerd
Date: Wed Jan 11 22:01:22 2017
New Revision: 51898

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=51898
Log:
* d/p/wayland-Handle-subsurface-as-popup-parent.patch
  - Added. Fix location of popup menus if the parent window is a subsurface
    (From upstream git, bgo#776225)
* d/p/wayland-Disable-EGL-swap-interval.patch
  - Added. Rely purely on the Gdk frame clock and disable EGL swap interval.
    Fixes the mainloop blocking when the compositor is throttling refreshes
    (From upstream git, bgo#769835)

Added:
    desktop/unstable/gtk+3.0/debian/patches/wayland-Disable-EGL-swap-interval.patch
    desktop/unstable/gtk+3.0/debian/patches/wayland-Handle-subsurface-as-popup-parent.patch
Modified:
    desktop/unstable/gtk+3.0/debian/changelog
    desktop/unstable/gtk+3.0/debian/patches/series

Modified: desktop/unstable/gtk+3.0/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gtk%2B3.0/debian/changelog?rev=51898&op=diff
==============================================================================
--- desktop/unstable/gtk+3.0/debian/changelog	[utf-8] (original)
+++ desktop/unstable/gtk+3.0/debian/changelog	[utf-8] Wed Jan 11 22:01:22 2017
@@ -1,3 +1,15 @@
+gtk+3.0 (3.22.6-2) UNRELEASED; urgency=medium
+
+  * d/p/wayland-Handle-subsurface-as-popup-parent.patch
+    - Added. Fix location of popup menus if the parent window is a subsurface
+      (From upstream git, bgo#776225)
+  * d/p/wayland-Disable-EGL-swap-interval.patch
+    - Added. Rely purely on the Gdk frame clock and disable EGL swap interval.
+      Fixes the mainloop blocking when the compositor is throttling refreshes
+      (From upstream git, bgo#769835)
+
+ -- Sjoerd Simons <sjoerd at debian.org>  Wed, 11 Jan 2017 22:22:09 +0100
+
 gtk+3.0 (3.22.6-1) unstable; urgency=medium
 
   [ Jeremy Bicha ]

Modified: desktop/unstable/gtk+3.0/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gtk%2B3.0/debian/patches/series?rev=51898&op=diff
==============================================================================
--- desktop/unstable/gtk+3.0/debian/patches/series	[utf-8] (original)
+++ desktop/unstable/gtk+3.0/debian/patches/series	[utf-8] Wed Jan 11 22:01:22 2017
@@ -7,3 +7,5 @@
 071_fix-installation-of-HTML-images.patch
 no-accessibility-dump.patch
 reftest-known-fail.patch
+wayland-Handle-subsurface-as-popup-parent.patch
+wayland-Disable-EGL-swap-interval.patch

Added: desktop/unstable/gtk+3.0/debian/patches/wayland-Disable-EGL-swap-interval.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gtk%2B3.0/debian/patches/wayland-Disable-EGL-swap-interval.patch?rev=51898&op=file
==============================================================================
--- desktop/unstable/gtk+3.0/debian/patches/wayland-Disable-EGL-swap-interval.patch	(added)
+++ desktop/unstable/gtk+3.0/debian/patches/wayland-Disable-EGL-swap-interval.patch	[utf-8] Wed Jan 11 22:01:22 2017
@@ -0,0 +1,103 @@
+From ab66c3d7bfaa316fc80a19e8aae32949b80068c1 Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg at gnome.org>
+Date: Thu, 22 Dec 2016 19:22:07 +0100
+Subject: [PATCH] wayland: Disable EGL swap interval
+
+We have a frame clock that ensures rendering is done as per the
+output vsync. There is no need to have Mesa do the same for us.
+
+This, most notably, ensures Mesa doesn't schedule frame callbacks
+that will be left unattended if the compositor stops throttling
+frames for its surface, this is eg. the case if the toplevel is
+moved to another workspace.
+
+Also, given a SwapInterval!=0 will always bring these unexpected
+side effects, check that it's possible to disable it, and spew
+a debug message if that isn't the case.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=769835
+---
+ gdk/wayland/gdkdisplay-wayland.h   |  1 +
+ gdk/wayland/gdkglcontext-wayland.c | 25 ++++++++++++++++++++++---
+ 2 files changed, 23 insertions(+), 3 deletions(-)
+
+diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
+index a68940f5b8..a9fd4831a4 100644
+--- a/gdk/wayland/gdkdisplay-wayland.h
++++ b/gdk/wayland/gdkdisplay-wayland.h
+@@ -120,6 +120,7 @@ struct _GdkWaylandDisplay
+   guint have_egl_buffer_age : 1;
+   guint have_egl_swap_buffers_with_damage : 1;
+   guint have_egl_surfaceless_context : 1;
++  EGLint egl_min_swap_interval;
+ };
+ 
+ struct _GdkWaylandDisplayClass
+diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
+index 657368860f..254900d1af 100644
+--- a/gdk/wayland/gdkglcontext-wayland.c
++++ b/gdk/wayland/gdkglcontext-wayland.c
+@@ -369,6 +369,7 @@ gdk_wayland_display_init_gl (GdkDisplay *display)
+ static gboolean
+ find_eglconfig_for_window (GdkWindow  *window,
+                            EGLConfig  *egl_config_out,
++                           EGLint     *min_swap_interval_out,
+                            GError    **error)
+ {
+   GdkDisplay *display = gdk_window_get_display (window);
+@@ -376,7 +377,7 @@ find_eglconfig_for_window (GdkWindow  *window,
+   GdkVisual *visual = gdk_window_get_visual (window);
+   EGLint attrs[MAX_EGL_ATTRS];
+   EGLint count;
+-  EGLConfig *configs;
++  EGLConfig *configs, chosen_config;
+   gboolean use_rgba;
+ 
+   int i = 0;
+@@ -429,9 +430,20 @@ find_eglconfig_for_window (GdkWindow  *window,
+     }
+ 
+   /* Pick first valid configuration i guess? */
++  chosen_config = configs[0];
++
++  if (!eglGetConfigAttrib (display_wayland->egl_display, chosen_config,
++                           EGL_MIN_SWAP_INTERVAL, min_swap_interval_out))
++    {
++      g_set_error_literal (error, GDK_GL_ERROR,
++                           GDK_GL_ERROR_NOT_AVAILABLE,
++                           "Could not retrieve the minimum swap interval");
++      g_free (configs);
++      return FALSE;
++    }
+ 
+   if (egl_config_out != NULL)
+-    *egl_config_out = configs[0];
++    *egl_config_out = chosen_config;
+ 
+   g_free (configs);
+ 
+@@ -465,7 +477,9 @@ gdk_wayland_window_create_gl_context (GdkWindow     *window,
+       return NULL;
+     }
+ 
+-  if (!find_eglconfig_for_window (window, &config, error))
++  if (!find_eglconfig_for_window (window, &config,
++                                  &display_wayland->egl_min_swap_interval,
++                                  error))
+     return NULL;
+ 
+   context = g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT,
+@@ -543,5 +557,10 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay   *display,
+       return FALSE;
+     }
+ 
++  if (display_wayland->egl_min_swap_interval == 0)
++    eglSwapInterval (display_wayland->egl_display, 0);
++  else
++    g_debug ("Can't disable GL swap interval");
++
+   return TRUE;
+ }
+-- 
+2.11.0
+

Added: desktop/unstable/gtk+3.0/debian/patches/wayland-Handle-subsurface-as-popup-parent.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gtk%2B3.0/debian/patches/wayland-Handle-subsurface-as-popup-parent.patch?rev=51898&op=file
==============================================================================
--- desktop/unstable/gtk+3.0/debian/patches/wayland-Handle-subsurface-as-popup-parent.patch	(added)
+++ desktop/unstable/gtk+3.0/debian/patches/wayland-Handle-subsurface-as-popup-parent.patch	[utf-8] Wed Jan 11 22:01:22 2017
@@ -0,0 +1,54 @@
+From 5bae71f896eb5516c04b1b2374aaff05cfb8b3c0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl at gmail.com>
+Date: Thu, 5 Jan 2017 16:01:49 +0800
+Subject: [PATCH] wayland: Handle subsurface as popup parent
+
+When a subsurface is used as a parent of a popup, GDK needs to traverse
+up to the transient-for as the next parent, to properly find the parent
+used by the popup positioner. This is because the parent of a popup
+must always either be an xdg_popup or an xdg_surface, but traversing
+the "parent" (in GDK terms) upwards from a subsurface will end up on
+the fake root window before we hit the actual parent (in Wayland terms).
+
+https://bugzilla.gnome.org/show_bug.cgi?id=776225
+---
+ gdk/wayland/gdkwindow-wayland.c | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
+index 0314117c31..8fce48bf28 100644
+--- a/gdk/wayland/gdkwindow-wayland.c
++++ b/gdk/wayland/gdkwindow-wayland.c
+@@ -1656,13 +1656,25 @@ get_real_parent_and_translate (GdkWindow *window,
+   GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+   GdkWindow *parent = impl->transient_for;
+ 
+-  while (parent &&
+-         !gdk_window_has_native (parent) &&
+-         gdk_window_get_effective_parent (parent))
++  while (parent)
+     {
++      GdkWindowImplWayland *parent_impl =
++        GDK_WINDOW_IMPL_WAYLAND (parent->impl);
++      GdkWindow *effective_parent = gdk_window_get_effective_parent (parent);
++
++      if ((gdk_window_has_native (parent) &&
++           !parent_impl->display_server.wl_subsurface) ||
++          !effective_parent)
++        break;
++
+       *x += parent->x;
+       *y += parent->y;
+-      parent = gdk_window_get_effective_parent (parent);
++
++      if (gdk_window_has_native (parent) &&
++          parent_impl->display_server.wl_subsurface)
++        parent = parent->transient_for;
++      else
++        parent = effective_parent;
+     }
+ 
+   return parent;
+-- 
+2.11.0
+




More information about the pkg-gnome-commits mailing list