x11: Do not discard shape region for undecorated windows

mutter would discard the shape region set by the client if its matches
the entire client area in meta_window_x11_update_shape_region().

However, if the window is later resized (maximized or other), the
compositor will fail to update the shape region properly for undecorated
windows because the shape region was discarded, which causes black areas
to appear in place of the updated areas.

If the client window is undecorated, keep the shape region even if when
it matches the client area.

https://gitlab.gnome.org/GNOME/mutter/issues/27

Closes: #27
This commit is contained in:
Olivier Fourdan 2018-02-15 09:18:26 +01:00
parent 6f59e4858e
commit 19bf4cf4f8

View File

@ -1933,11 +1933,11 @@ meta_window_x11_update_shape_region (MetaWindow *window)
* this is simply the client area. * this is simply the client area.
*/ */
cairo_region_intersect_rectangle (region, &client_area); cairo_region_intersect_rectangle (region, &client_area);
/* Some applications might explicitly set their bounding region /* Some applications might explicitly set their bounding region
* to the client area. Detect these cases, and throw out the * to the client area. Detect these cases, and throw out the
* bounding region in this case. */ * bounding region in this case for decorated windows. */
if (cairo_region_contains_rectangle (region, &client_area) == CAIRO_REGION_OVERLAP_IN) if (window->decorated &&
cairo_region_contains_rectangle (region, &client_area) == CAIRO_REGION_OVERLAP_IN)
g_clear_pointer (&region, cairo_region_destroy); g_clear_pointer (&region, cairo_region_destroy);
} }