Bug ID: 771553
           Summary: Shrinking window generates a black patch when gl is
    Classification: Platform
           Product: gtk+
           Version: 3.21.x
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: Backend: Wayland
        QA Contact:
     GNOME version: ---

Created attachment 335732
Screenshot showing the problem

I am not sure why this does not affect the GLArea widget. In the WebKitGTK+
test browser, when we use gdk_cairo_draw_from_gl to paint the final rendering
to GTK+, we get this weird behaviour.

My investigation points to the tracking of the opaque region. The opaque region
is properly set on the GdkWindowWayland, but never synced. When using the
glReadPixels codepath in WebKitGTK+, the opaque region is synced for every

The reason seems to be pending_commit is never true (except for a few early
frames), so the call to sync_opaque_region is never reached:

static void
on_frame_clock_after_paint (GdkFrameClock *clock,
                            GdkWindow     *window)
  GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
  struct wl_callback *callback;

  if (!impl->pending_commit)
  gdk_wayland_window_sync_margin (window);
  gdk_wayland_window_sync_opaque_region (window);
  gdk_wayland_window_sync_input_region (window);

The reason why pending_commit is never true is it is only updated when
current_paint.use_gl is not true:

static void
gdk_window_impl_wayland_end_paint (GdkWindow *window)
  GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
  cairo_rectangle_int_t rect;
  int i, n;

  if (!window->current_paint.use_gl &&
      !cairo_region_is_empty (window->current_paint.region))
      impl->pending_commit = TRUE;

You are receiving this mail because:
You are on the CC list for the bug.
wayland-bugs mailing list

Reply via email to