Merge branch 'wip/otte/for-master' into 'master'

Wip/otte/for master

See merge request GNOME/gtk!3279
This commit is contained in:
Benjamin Otte 2021-03-09 19:11:09 +00:00
commit c696385130
3 changed files with 22 additions and 25 deletions

View File

@ -109,6 +109,8 @@ gdk_wayland_cairo_context_buffer_release (void *_data,
/* Get rid of all the extra ones */
gdk_wayland_cairo_context_remove_surface (self, cairo_surface);
/* Release the reference the compositor held to this surface */
cairo_surface_destroy (cairo_surface);
}
static const struct wl_buffer_listener buffer_listener = {
@ -194,7 +196,7 @@ gdk_wayland_cairo_context_end_frame (GdkDrawContext *draw_context,
static void
gdk_wayland_cairo_context_clear_all_cairo_surfaces (GdkWaylandCairoContext *self)
{
self->cached_surface = NULL;
g_clear_pointer (&self->cached_surface, cairo_surface_destroy);
while (self->surfaces)
gdk_wayland_cairo_context_remove_surface (self, self->surfaces->data);
}
@ -221,6 +223,8 @@ gdk_wayland_cairo_context_dispose (GObject *object)
GdkWaylandCairoContext *self = GDK_WAYLAND_CAIRO_CONTEXT (object);
gdk_wayland_cairo_context_clear_all_cairo_surfaces (self);
g_assert (self->cached_surface == NULL);
g_assert (self->paint_surface == NULL);
G_OBJECT_CLASS (gdk_wayland_cairo_context_parent_class)->dispose (object);
}

View File

@ -284,11 +284,6 @@ static void gdk_wayland_surface_maybe_resize (GdkSurface *surface,
int height,
int scale);
static void gdk_wayland_surface_resize (GdkSurface *surface,
int width,
int height,
int scale);
static void gdk_wayland_surface_configure (GdkSurface *surface);
static void maybe_set_gtk_surface_dbus_properties (GdkWaylandSurface *impl);
@ -415,6 +410,8 @@ gdk_wayland_surface_update_size (GdkSurface *surface,
g_object_notify (G_OBJECT (surface), "height");
if (scale_changed)
g_object_notify (G_OBJECT (surface), "scale-factor");
_gdk_surface_update_size (surface);
}
static const char *
@ -650,10 +647,10 @@ configure_drag_surface_geometry (GdkSurface *surface)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
gdk_wayland_surface_resize (surface,
impl->next_layout.configured_width,
impl->next_layout.configured_height,
impl->scale);
gdk_wayland_surface_update_size (surface,
impl->next_layout.configured_width,
impl->next_layout.configured_height,
impl->scale);
}
static gboolean
@ -1010,16 +1007,6 @@ is_realized_popup (GdkWaylandSurface *impl)
impl->display_server.zxdg_popup_v6);
}
static void
gdk_wayland_surface_resize (GdkSurface *surface,
int width,
int height,
int scale)
{
gdk_wayland_surface_update_size (surface, width, height, scale);
_gdk_surface_update_size (surface);
}
static void gdk_wayland_surface_show (GdkSurface *surface,
gboolean already_mapped);
static void gdk_wayland_surface_hide (GdkSurface *surface);
@ -1051,7 +1038,7 @@ gdk_wayland_surface_maybe_resize (GdkSurface *surface,
if (is_xdg_popup && is_visible && !impl->initial_configure_received)
gdk_wayland_surface_hide (surface);
gdk_wayland_surface_resize (surface, width, height, scale);
gdk_wayland_surface_update_size (surface, width, height, scale);
if (is_xdg_popup && is_visible && !impl->initial_configure_received)
gdk_wayland_surface_show (surface, FALSE);
@ -1416,7 +1403,7 @@ configure_toplevel_geometry (GdkSurface *surface)
width, height,
&width, &height);
}
gdk_wayland_surface_resize (surface, width, height, impl->scale);
gdk_wayland_surface_update_size (surface, width, height, impl->scale);
if (!impl->next_layout.toplevel.size_is_fixed)
{
@ -1434,7 +1421,7 @@ configure_toplevel_geometry (GdkSurface *surface)
gdk_surface_constrain_size (&geometry, mask,
width, height,
&width, &height);
gdk_wayland_surface_resize (surface, width, height, impl->scale);
gdk_wayland_surface_update_size (surface, width, height, impl->scale);
}
}

View File

@ -113,7 +113,7 @@ gsk_vulkan_clip_intersect_rounded_rect (GskVulkanClip *dest,
case GSK_VULKAN_CLIP_RECT:
if (graphene_rect_contains_rect (&src->rect.bounds, &rounded->bounds))
{
dest->type = gsk_rounded_rect_is_circular (&dest->rect) ? GSK_VULKAN_CLIP_ROUNDED_CIRCULAR : GSK_VULKAN_CLIP_ROUNDED;
dest->type = gsk_rounded_rect_is_circular (rounded) ? GSK_VULKAN_CLIP_ROUNDED_CIRCULAR : GSK_VULKAN_CLIP_ROUNDED;
gsk_rounded_rect_init_copy (&dest->rect, rounded);
return TRUE;
}
@ -126,7 +126,13 @@ gsk_vulkan_clip_intersect_rounded_rect (GskVulkanClip *dest,
case GSK_VULKAN_CLIP_ROUNDED_CIRCULAR:
case GSK_VULKAN_CLIP_ROUNDED:
/* XXX: improve */
if (gsk_rounded_rect_contains_rect (&src->rect, &rounded->bounds))
{
dest->type = gsk_rounded_rect_is_circular (rounded) ? GSK_VULKAN_CLIP_ROUNDED_CIRCULAR : GSK_VULKAN_CLIP_ROUNDED;
gsk_rounded_rect_init_copy (&dest->rect, rounded);
return TRUE;
}
/* XXX: Can be improved for the case where one of the rects is a slighty shrunk version of the other */
return FALSE;
default: