1
0
Fork 0

wayland-surface: Replace MetaWindowActor with MetaSurfaceActor

Since subsurfaces won't have toplevel MetaWindowActors, we need to
use MetaSurfaceActor instead. These are embedded in the MetaWindowActor,
just like MetaShapedTexture was (in fact, MetaSurfaceActor now contains
a MetaShapedTexture)
This commit is contained in:
Jasper St. Pierre 2013-11-22 15:24:06 -05:00
parent 025ab35af7
commit 304005e04f
6 changed files with 25 additions and 57 deletions

View file

@ -15,6 +15,7 @@
#include <cogl/cogl-texture-pixmap-x11.h>
#include <meta/meta-shaped-texture.h>
#include "meta-surface-actor.h"
#include "meta-wayland-private.h"
#include "meta-cullable.h"
#include "meta-shaped-texture-private.h"

View file

@ -6,7 +6,7 @@
#include <config.h>
#include <meta/meta-shaped-texture.h>
#include "meta-wayland-private.h"
#include "meta-wayland-types.h"
G_BEGIN_DECLS

View file

@ -31,14 +31,6 @@ void meta_window_actor_unmaximize (MetaWindowActor *self,
void meta_window_actor_process_x11_damage (MetaWindowActor *self,
XDamageNotifyEvent *event);
void meta_window_actor_process_wayland_damage (MetaWindowActor *self,
int x,
int y,
int width,
int height);
void meta_window_actor_attach_wayland_buffer (MetaWindowActor *self,
MetaWaylandBuffer *buffer);
void meta_window_actor_pre_paint (MetaWindowActor *self);
void meta_window_actor_post_paint (MetaWindowActor *self);
void meta_window_actor_frame_complete (MetaWindowActor *self,

View file

@ -409,6 +409,9 @@ meta_window_actor_constructed (GObject *object)
{
priv->surface = meta_surface_actor_new ();
if (window->surface)
window->surface->surface_actor = priv->surface;
clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
priv->surface_allocation_changed_id =
@ -2149,30 +2152,6 @@ meta_window_actor_process_x11_damage (MetaWindowActor *self,
}
void
meta_window_actor_process_wayland_damage (MetaWindowActor *self,
int x,
int y,
int width,
int height)
{
MetaWindowActorPrivate *priv = self->priv;
cairo_region_t *unobscured_region;
gboolean redraw_queued;
if (!priv->mapped)
return;
unobscured_region =
clutter_actor_has_mapped_clones (CLUTTER_ACTOR (priv->surface))
? NULL : priv->unobscured_region;
redraw_queued = meta_surface_actor_damage_area (priv->surface,
x, y, width, height,
unobscured_region);
priv->repaint_scheduled = priv->repaint_scheduled || redraw_queued;
}
void
meta_window_actor_sync_visibility (MetaWindowActor *self)
{
@ -2446,8 +2425,12 @@ check_needs_reshape (MetaWindowActor *self)
client_area.height = priv->window->rect.height;
meta_window_actor_update_shape_region (self, &client_area);
meta_window_actor_update_input_region (self, &client_area);
meta_window_actor_update_opaque_region (self);
if (priv->window->client_type == META_WINDOW_CLIENT_TYPE_X11)
{
meta_window_actor_update_input_region (self, &client_area);
meta_window_actor_update_opaque_region (self);
}
priv->needs_reshape = FALSE;
}
@ -2465,14 +2448,6 @@ meta_window_actor_update_shape (MetaWindowActor *self)
clutter_actor_queue_redraw (CLUTTER_ACTOR (priv->surface));
}
void
meta_window_actor_attach_wayland_buffer (MetaWindowActor *self,
MetaWaylandBuffer *buffer)
{
MetaWindowActorPrivate *priv = self->priv;
meta_surface_actor_attach_wayland_buffer (priv->surface, buffer);
}
static void
meta_window_actor_handle_updates (MetaWindowActor *self)
{

View file

@ -44,7 +44,7 @@
#include "meta-wayland-private.h"
#include "meta-xwayland-private.h"
#include "meta-wayland-stage.h"
#include "meta-window-actor-private.h"
#include "meta-surface-actor.h"
#include "meta-wayland-seat.h"
#include "meta-wayland-keyboard.h"
#include "meta-wayland-pointer.h"
@ -67,8 +67,6 @@ surface_process_damage (MetaWaylandSurface *surface,
if (surface->buffer_ref.buffer)
{
MetaWindowActor *window_actor =
META_WINDOW_ACTOR (meta_window_get_compositor_private (surface->window));
MetaRectangle rect;
cairo_rectangle_int_t cairo_rect;
@ -80,7 +78,7 @@ surface_process_damage (MetaWaylandSurface *surface,
cairo_region_intersect_rectangle (region, &cairo_rect);
if (window_actor)
if (surface->surface_actor)
{
int i, n_rectangles = cairo_region_num_rectangles (region);
@ -90,11 +88,12 @@ surface_process_damage (MetaWaylandSurface *surface,
cairo_region_get_rectangle (region, i, &rectangle);
meta_window_actor_process_wayland_damage (window_actor,
rectangle.x,
rectangle.y,
rectangle.width,
rectangle.height);
meta_surface_actor_damage_area (surface->surface_actor,
rectangle.x,
rectangle.y,
rectangle.width,
rectangle.height,
NULL);
}
}
}
@ -278,6 +277,7 @@ cursor_surface_commit (MetaWaylandSurface *surface)
static void
toplevel_surface_commit (MetaWaylandSurface *surface)
{
MetaSurfaceActor *surface_actor = surface->surface_actor;
MetaWindow *window = surface->window;
MetaWaylandBuffer *buffer = surface->pending.buffer;
@ -291,9 +291,7 @@ toplevel_surface_commit (MetaWaylandSurface *surface)
if (buffer != NULL)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
meta_window_actor_attach_wayland_buffer (window_actor, buffer);
meta_surface_actor_attach_wayland_buffer (surface_actor, buffer);
/* We resize X based surfaces according to X events */
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
@ -316,9 +314,9 @@ toplevel_surface_commit (MetaWaylandSurface *surface)
surface_process_damage (surface, surface->pending.damage);
if (surface->pending.opaque_region)
meta_window_set_opaque_region (window, surface->pending.opaque_region);
meta_surface_actor_set_opaque_region (surface_actor, surface->pending.opaque_region);
if (surface->pending.input_region)
meta_window_set_input_region (window, surface->pending.input_region);
meta_surface_actor_set_input_region (surface_actor, surface->pending.input_region);
}
static void

View file

@ -29,6 +29,7 @@
#include <meta/meta-cursor-tracker.h>
#include "meta-wayland-types.h"
#include "meta-surface-actor.h"
struct _MetaWaylandBuffer
{
@ -77,6 +78,7 @@ struct _MetaWaylandSurface
struct wl_resource *resource;
MetaWaylandCompositor *compositor;
MetaWaylandBufferReference buffer_ref;
MetaSurfaceActor *surface_actor;
MetaWindow *window;
MetaWaylandSurfaceExtension xdg_surface;
MetaWaylandSurfaceExtension xdg_popup;