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 18:45:25 -0600
commit52236bdb371686af4b668991d63f89bf44e32cca (patch)
tree3b20d3fdf1a81d69d5cb9bf76d3a12a35e6517fb
parent4f49bef319b6c3145ae71c04d5a37c797c67e5b6 (diff)
downloadmutter-wip/frame-extents-fixes.tar.gz
window: Adjust the frame rect when _GTK_FRAME_EXTENTS is set on mapwip/frame-extents-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);
}
}