summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-09-17 12:17:01 -0600
committerJasper St. Pierre <jstpierre@mecheye.net>2014-09-17 15:08:58 -0600
commitd4d3aef40e32d99d03686f4b73a885f45ab419bf (patch)
tree2e82145fc7c24de72a916d70fcb9387373d0dd93
parent55b910f183ec7315f61088b2e268f8379ebd20b5 (diff)
downloadmutter-wip/wayland-fixes.tar.gz
window: Adjust the frame rect when _GTK_FRAME_EXTENTS is set on mapwip/wayland-fixes
-rw-r--r--src/x11/window-props.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/x11/window-props.c b/src/x11/window-props.c
index e857788c1..316498564 100644
--- a/src/x11/window-props.c
+++ b/src/x11/window-props.c
@@ -350,7 +350,8 @@ gtk_border_equal (GtkBorder *a,
static void
meta_window_set_custom_frame_extents (MetaWindow *window,
- GtkBorder *extents)
+ GtkBorder *extents,
+ gboolean is_initial)
{
if (extents)
{
@@ -359,6 +360,17 @@ meta_window_set_custom_frame_extents (MetaWindow *window,
window->has_custom_frame_extents = TRUE;
window->custom_frame_extents = *extents;
+
+ /* If we're setting the frame extents on map, then this is telling
+ * us to adjust our understanding of the frame rect to match what
+ * GTK+ thinks it is. Future changes to the frame extents should
+ * trigger a resize and send a ConfigureRequest to the application.
+ */
+ if (is_initial)
+ {
+ meta_window_client_rect_to_frame_rect (window, &window->rect, &window->rect);
+ meta_window_client_rect_to_frame_rect (window, &window->unconstrained_rect, &window->unconstrained_rect);
+ }
}
else
{
@@ -391,12 +403,12 @@ reload_gtk_frame_extents (MetaWindow *window,
extents.right = (int)value->v.cardinal_list.cardinals[1];
extents.top = (int)value->v.cardinal_list.cardinals[2];
extents.bottom = (int)value->v.cardinal_list.cardinals[3];
- meta_window_set_custom_frame_extents (window, &extents);
+ meta_window_set_custom_frame_extents (window, &extents, initial);
}
}
else
{
- meta_window_set_custom_frame_extents (window, NULL);
+ meta_window_set_custom_frame_extents (window, NULL, initial);
}
}