[gtk/wip/baedert/for-master: 10/13] window: Don't set invalid csd input shape
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 10/13] window: Don't set invalid csd input shape
- Date: Fri, 29 Nov 2019 13:46:24 +0000 (UTC)
commit 9886e4f4263d006ee2ba392da9dc09a5a529be9b
Author: Timm Bäder <mail baedert org>
Date: Fri Nov 29 10:02:14 2019 +0100
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
gtk/gtkwindow.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 24ced0c171..201ea94532 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]