wayland: Drop GdkWaylandSubsurface.above_parent

This is now tracked in GdkSubsurface.
This commit is contained in:
Matthias Clasen 2024-02-07 11:18:57 +00:00
parent eaf944938b
commit 3cb1b9d4cb
4 changed files with 7 additions and 21 deletions

View File

@ -61,7 +61,6 @@ struct _GdkSubsurfaceClass
GdkTexture * (* get_texture) (GdkSubsurface *subsurface);
void (* get_rect) (GdkSubsurface *subsurface,
graphene_rect_t *rect);
gboolean (* is_above_parent) (GdkSubsurface *subsurface);
};
GType gdk_subsurface_get_type (void) G_GNUC_CONST;

View File

@ -26,8 +26,6 @@ struct _GdkWaylandSubsurface
struct wl_region *opaque_region;
struct wl_callback *frame_callback;
gboolean above_parent;
};
struct _GdkWaylandSubsurfaceClass

View File

@ -166,8 +166,8 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
graphene_rect_t device_rect;
cairo_rectangle_int_t device_dest;
if (sib)
will_be_above = sib->above_parent;
if (sibling)
will_be_above = sibling->above_parent;
else
will_be_above = above;
@ -322,8 +322,6 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
wl_subsurface_place_above (self->subsurface, sib->surface);
else
wl_subsurface_place_below (self->subsurface, sib->surface);
self->above_parent = sib->above_parent;
}
else
{
@ -333,7 +331,6 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
else
wl_subsurface_place_below (self->subsurface,
GDK_WAYLAND_SURFACE (sub->parent)->display_server.wl_surface);
self->above_parent = above;
}
wl_surface_commit (self->surface);
@ -384,14 +381,6 @@ gdk_wayland_subsurface_get_rect (GdkSubsurface *sub,
rect->size.height = self->dest.height;
}
static gboolean
gdk_wayland_subsurface_is_above_parent (GdkSubsurface *sub)
{
GdkWaylandSubsurface *self = (GdkWaylandSubsurface *)sub;
return self->above_parent;
}
static void
gdk_wayland_subsurface_class_init (GdkWaylandSubsurfaceClass *class)
{
@ -404,7 +393,6 @@ gdk_wayland_subsurface_class_init (GdkWaylandSubsurfaceClass *class)
subsurface_class->detach = gdk_wayland_subsurface_detach;
subsurface_class->get_texture = gdk_wayland_subsurface_get_texture;
subsurface_class->get_rect = gdk_wayland_subsurface_get_rect;
subsurface_class->is_above_parent = gdk_wayland_subsurface_is_above_parent;
};
static void
@ -478,8 +466,6 @@ gdk_wayland_surface_create_subsurface (GdkSurface *surface)
wl_region_add (sub->opaque_region, 0, 0, G_MAXINT, G_MAXINT);
wl_surface_set_opaque_region (sub->surface, sub->opaque_region);
sub->above_parent = TRUE;
GDK_DISPLAY_DEBUG (display, OFFLOAD, "Subsurface %p of surface %p created", sub, impl);
return GDK_SUBSURFACE (sub);

View File

@ -646,9 +646,12 @@ gdk_wayland_surface_sync_opaque_region (GdkSurface *surface)
cairo_region_t *region = cairo_region_copy (impl->opaque_region);
for (gsize i = 0; i < gdk_surface_get_n_subsurfaces (surface); i++)
{
GdkWaylandSubsurface *sub = (GdkWaylandSubsurface *)gdk_surface_get_subsurface (surface, i);
if (sub->above_parent)
GdkSubsurface *subsurface = gdk_surface_get_subsurface (surface, i);
GdkWaylandSubsurface *sub = (GdkWaylandSubsurface *) subsurface;
if (subsurface->above_parent)
continue;
if (sub->texture != NULL)
cairo_region_subtract_rectangle (region, &sub->dest);
}