forked from AuroraMiddleware/gtk
window: fix opaque region
Decoration node for drawing is used only for client side decorated windows, but corners from opaque region is subtracted also for normal windows. Rename function to better reflect what it does and do not subtract corners if decoration node was not used for drawing.
This commit is contained in:
parent
fe385c28f6
commit
e81a90c432
@ -5420,14 +5420,20 @@ corner_rect (cairo_rectangle_int_t *rect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
subtract_corners_from_region (cairo_region_t *region,
|
subtract_decoration_corners_from_region (cairo_region_t *region,
|
||||||
cairo_rectangle_int_t *extents,
|
cairo_rectangle_int_t *extents,
|
||||||
GtkStyleContext *context,
|
GtkStyleContext *context,
|
||||||
GtkWindow *window)
|
GtkWindow *window)
|
||||||
{
|
{
|
||||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||||
cairo_rectangle_int_t rect;
|
cairo_rectangle_int_t rect;
|
||||||
|
|
||||||
|
if (!priv->client_decorated ||
|
||||||
|
!priv->decorated ||
|
||||||
|
priv->fullscreen ||
|
||||||
|
priv->maximized)
|
||||||
|
return;
|
||||||
|
|
||||||
gtk_style_context_save_to_node (context, priv->decoration_node);
|
gtk_style_context_save_to_node (context, priv->decoration_node);
|
||||||
|
|
||||||
corner_rect (&rect, _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS));
|
corner_rect (&rect, _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS));
|
||||||
@ -5485,7 +5491,7 @@ update_opaque_region (GtkWindow *window,
|
|||||||
|
|
||||||
opaque_region = cairo_region_create_rectangle (&rect);
|
opaque_region = cairo_region_create_rectangle (&rect);
|
||||||
|
|
||||||
subtract_corners_from_region (opaque_region, &rect, context, window);
|
subtract_decoration_corners_from_region (opaque_region, &rect, context, window);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user