Fix input and bounding shapes

For decorated windows, we don't want to apply any input
shape, because the frame is always rectangular and eats
all the input.
The real check is in meta-window-actor, where we consider
if we need to apply the bounding shape and the input shape
(or the intersection of the two) to the surface-actor,
but as an optimization we avoid querying the server in
meta-window.
Additionally, for undecorated windows, the "has input shape"
check is wrong if the window has a bounding shape but not an
input shape.
This commit is contained in:
Giovanni Campagna
2014-02-25 01:22:36 +01:00
parent 45624f2edf
commit 9f5087e97d
2 changed files with 50 additions and 23 deletions

View File

@@ -1760,21 +1760,27 @@ meta_window_actor_update_input_region (MetaWindowActor *self,
MetaWindowActorPrivate *priv = self->priv;
cairo_region_t *region = NULL;
if (priv->window->frame != NULL && priv->window->input_region != NULL)
if (priv->window->frame != NULL)
{
region = meta_frame_get_frame_bounds (priv->window->frame);
cairo_region_subtract_rectangle (region, client_area);
/* input_region is in client window coordinates, so translate the
/* client area is in client window coordinates, so translate the
* input region into that coordinate system and back */
cairo_region_translate (region, -client_area->x, -client_area->y);
cairo_region_union (region, priv->window->input_region);
cairo_region_union_rectangle (region, client_area);
cairo_region_translate (region, client_area->x, client_area->y);
}
else if (priv->window->input_region != NULL)
else if (priv->window->shape_region != NULL ||
priv->window->input_region != NULL)
{
region = cairo_region_reference (priv->window->input_region);
if (priv->window->shape_region != NULL)
{
region = cairo_region_copy (priv->window->shape_region);
if (priv->window->input_region != NULL)
cairo_region_intersect (region, priv->window->input_region);
}
else
region = cairo_region_reference (priv->window->input_region);
}
else
{