summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-06-10 23:58:27 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-06-11 00:04:04 -0400
commit2d05bf1492c6448df98ecf04c913a33df665ca34 (patch)
treea031c9a64e6fe452e928d0347d278938f58fe306
parenta4b0d35649d249427f7deb801dd49f3fdc0ff83f (diff)
downloadgtk+-2d05bf1492c6448df98ecf04c913a33df665ca34.tar.gz
csd: Fix non-resizable windows
For csd override-redirect windows, we don't set up resize handles, but we were not ignoring the margin in all places, causing some size calculations to go wrong.
-rw-r--r--gtk/gtkwindow.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 2db3015401..39d3a68cd9 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6787,9 +6787,12 @@ get_shadow_width (GtkWidget *widget,
shadows = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BOX_SHADOW);
_gtk_css_shadows_value_get_extents (shadows, &border);
- /* ... and compare it to the margin size, which we use for resize grips */
- gtk_style_context_get_margin (context, s, &margin);
- max_borders (&border, &margin);
+ if (priv->type != GTK_WINDOW_POPUP)
+ {
+ /* ... and compare it to the margin size, which we use for resize grips */
+ gtk_style_context_get_margin (context, s, &margin);
+ max_borders (&border, &margin);
+ }
sum_borders (&d, &border);
max_borders (shadow_width, &d);
@@ -7039,7 +7042,9 @@ shape:
* outside the border windows go through
*/
- subtract_borders (&window_border, &border);
+ if (priv->type != GTK_WINDOW_POPUP)
+ subtract_borders (&window_border, &border);
+
rect.x = window_border.left;
rect.y = window_border.top;
rect.width = gtk_widget_get_allocated_width (widget) - window_border.left - window_border.right;