forked from AuroraMiddleware/gtk
wayland/surface: Make sure to commit ack_configure
We must wl_surface.commit after xdg_surface.ack_configure to make it have an effect. We failed to do so when a configure event didn't result in new updates, so make sure we fall back on an simple wl_surface.commit if there was no new actual frame painted. Closes: #2910
This commit is contained in:
parent
1abcd6f304
commit
4200936f21
@ -185,6 +185,7 @@ gdk_wayland_cairo_context_end_frame (GdkDrawContext *draw_context,
|
||||
|
||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
|
||||
gdk_wayland_surface_commit (surface);
|
||||
gdk_wayland_surface_notify_committed (surface);
|
||||
|
||||
gdk_wayland_cairo_context_surface_clear_region (self->paint_surface);
|
||||
self->paint_surface = NULL;
|
||||
|
@ -261,6 +261,8 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
|
||||
}
|
||||
else
|
||||
eglSwapBuffers (display_wayland->egl_display, egl_surface);
|
||||
|
||||
gdk_wayland_surface_notify_committed (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -95,6 +95,7 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
|
||||
|
||||
void gdk_wayland_surface_sync (GdkSurface *surface);
|
||||
void gdk_wayland_surface_commit (GdkSurface *surface);
|
||||
void gdk_wayland_surface_notify_committed (GdkSurface *surface);
|
||||
void gdk_wayland_surface_request_frame (GdkSurface *surface);
|
||||
void gdk_wayland_surface_attach_image (GdkSurface *surface,
|
||||
cairo_surface_t *cairo_surface,
|
||||
|
@ -94,6 +94,7 @@ struct _GdkWaylandSurface
|
||||
PopupState popup_state;
|
||||
|
||||
unsigned int initial_configure_received : 1;
|
||||
unsigned int has_uncommitted_ack_configure : 1;
|
||||
unsigned int mapped : 1;
|
||||
unsigned int awaiting_frame : 1;
|
||||
unsigned int awaiting_frame_frozen : 1;
|
||||
@ -622,12 +623,26 @@ gdk_wayland_surface_commit (GdkSurface *surface)
|
||||
wl_surface_commit (impl->display_server.wl_surface);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_surface_notify_committed (GdkSurface *surface)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
impl->has_uncommitted_ack_configure = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
GdkSurface *surface)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
if (surface->update_freeze_count == 0 && impl->has_uncommitted_ack_configure)
|
||||
{
|
||||
gdk_wayland_surface_commit (surface);
|
||||
gdk_wayland_surface_notify_committed (surface);
|
||||
}
|
||||
|
||||
if (impl->awaiting_frame &&
|
||||
impl->pending_frame_counter == gdk_frame_clock_get_frame_counter (clock))
|
||||
{
|
||||
@ -1458,6 +1473,8 @@ gdk_wayland_surface_configure (GdkSurface *surface)
|
||||
impl->pending.is_initial_configure = TRUE;
|
||||
}
|
||||
|
||||
impl->has_uncommitted_ack_configure = TRUE;
|
||||
|
||||
if (is_realized_popup (surface))
|
||||
gdk_wayland_surface_configure_popup (surface);
|
||||
else if (is_realized_toplevel (surface))
|
||||
|
@ -69,6 +69,8 @@ gdk_vulkan_context_wayland_end_frame (GdkDrawContext *context,
|
||||
gdk_wayland_surface_request_frame (surface);
|
||||
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted);
|
||||
|
||||
gdk_wayland_surface_notify_committed (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user