[gtk/matthiasc/surface-state-rework: 38/80] gdk/toplevelsize: Don't complain if only shadow extends out of bounds
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/surface-state-rework: 38/80] gdk/toplevelsize: Don't complain if only shadow extends out of bounds
- Date: Sat, 5 Dec 2020 17:42:39 +0000 (UTC)
commit 0b525792815076a5a1cd5b7621601f752f025a88
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Dec 2 10:57:32 2020 +0100
gdk/toplevelsize: Don't complain if only shadow extends out of bounds
gdk/gdktoplevelsize.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdktoplevelsize.c b/gdk/gdktoplevelsize.c
index 7cd09ebd5e..a1c6ded32d 100644
--- a/gdk/gdktoplevelsize.c
+++ b/gdk/gdktoplevelsize.c
@@ -135,15 +135,24 @@ gdk_toplevel_size_set_margin (GdkToplevelSize *size,
void
gdk_toplevel_size_validate (GdkToplevelSize *size)
{
+ int geometry_width, geometry_height;
+
if (size->min_width > size->bounds_width ||
size->min_height > size->bounds_height)
g_warning ("GdkToplevelSize: min_size (%d, %d) exceeds bounds (%d, %d)",
size->min_width, size->min_height,
size->bounds_width, size->bounds_height);
- if (size->width > size->bounds_width ||
- size->height > size->bounds_height)
- g_warning ("GdkToplevelSize: size (%d, %d) exceeds bounds (%d, %d)",
+ geometry_width = size->width;
+ geometry_height = size->height;
+ if (size->margin.is_valid)
+ {
+ geometry_width -= size->margin.left + size->margin.right;
+ geometry_height -= size->margin.top + size->margin.bottom;
+ }
+ if (geometry_width > size->bounds_width ||
+ geometry_height > size->bounds_height)
+ g_warning ("GdkToplevelSize: geometry size (%d, %d) exceeds bounds (%d, %d)",
size->width, size->height,
size->bounds_width, size->bounds_height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]