Commit 83ec7d56 authored by Timm Bäder's avatar Timm Bäder 👎

window: Don't set invalid csd input shape

This might happen if the CSS values of the decoration node are broken,
e.g. if people *accidentally* type large negative values for the
margins.

Fixes #2268
parent 05e9a9b5
......@@ -5361,7 +5361,6 @@ update_csd_shape (GtkWindow *window)
{
GtkWidget *widget = (GtkWidget *)window;
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
cairo_region_t *region;
cairo_rectangle_int_t rect;
GtkBorder border, tmp;
GtkBorder window_border;
......@@ -5392,9 +5391,13 @@ update_csd_shape (GtkWindow *window)
rect.y = window_border.top;
rect.width = gtk_widget_get_allocated_width (widget) - window_border.left - window_border.right;
rect.height = gtk_widget_get_allocated_height (widget) - window_border.top - window_border.bottom;
region = cairo_region_create_rectangle (&rect);
gtk_widget_set_csd_input_shape (widget, region);
cairo_region_destroy (region);
if (rect.width > 0 && rect.height > 0)
{
cairo_region_t *region = cairo_region_create_rectangle (&rect);
gtk_widget_set_csd_input_shape (widget, region);
cairo_region_destroy (region);
}
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment