mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
window-actor: Fix the input shape region for decorated X11 windows
The code here before was completely wrong. Not only did it mix up coordinate spaces of "client rect" vs. "frame rect", but it used meta_frame_get_frame_bounds, which is specifically for the *visible* bounds of a window! In the case that we don't have a bounding or input shape region at all on the client window, the input shape that we should apply is the surface's natural shape. So, set the region to NULL to get the natural rect picking semantics.
This commit is contained in:
parent
0f9b29b140
commit
82e02e39d3
@ -1738,41 +1738,20 @@ static void
|
|||||||
meta_window_actor_update_input_region (MetaWindowActor *self)
|
meta_window_actor_update_input_region (MetaWindowActor *self)
|
||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv = self->priv;
|
MetaWindowActorPrivate *priv = self->priv;
|
||||||
cairo_region_t *region = NULL;
|
MetaWindow *window = priv->window;
|
||||||
cairo_rectangle_int_t client_area;
|
cairo_region_t *region;
|
||||||
|
|
||||||
meta_window_get_client_area_rect (priv->window, &client_area);
|
if (window->shape_region && window->input_region)
|
||||||
|
|
||||||
if (priv->window->frame != NULL)
|
|
||||||
{
|
{
|
||||||
region = meta_frame_get_frame_bounds (priv->window->frame);
|
region = cairo_region_copy (window->shape_region);
|
||||||
|
cairo_region_intersect (region, window->input_region);
|
||||||
/* input_region 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_rectangle (region, &client_area);
|
|
||||||
cairo_region_translate (region, client_area.x, client_area.y);
|
|
||||||
}
|
|
||||||
else if (priv->window->shape_region != NULL ||
|
|
||||||
priv->window->input_region != NULL)
|
|
||||||
{
|
|
||||||
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 if (window->shape_region)
|
||||||
|
region = cairo_region_reference (window->shape_region);
|
||||||
|
else if (window->input_region)
|
||||||
|
region = cairo_region_reference (window->input_region);
|
||||||
else
|
else
|
||||||
region = cairo_region_reference (priv->window->input_region);
|
region = NULL;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* If we don't have a shape on the server, that means that
|
|
||||||
* we have an implicit shape of one rectangle covering the
|
|
||||||
* entire window. */
|
|
||||||
region = cairo_region_create_rectangle (&client_area);
|
|
||||||
}
|
|
||||||
|
|
||||||
meta_surface_actor_set_input_region (priv->surface, region);
|
meta_surface_actor_set_input_region (priv->surface, region);
|
||||||
cairo_region_destroy (region);
|
cairo_region_destroy (region);
|
||||||
|
Loading…
Reference in New Issue
Block a user