[mutter/wip/frame-extents-fixes: 3/3] window: Adjust the frame rect when _GTK_FRAME_EXTENTS is set on map
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/frame-extents-fixes: 3/3] window: Adjust the frame rect when _GTK_FRAME_EXTENTS is set on map
- Date: Thu, 18 Sep 2014 00:45:58 +0000 (UTC)
commit 52236bdb371686af4b668991d63f89bf44e32cca
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Sep 17 12:17:01 2014 -0600
window: Adjust the frame rect when _GTK_FRAME_EXTENTS is set on map
src/x11/window-props.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/x11/window-props.c b/src/x11/window-props.c
index e857788..3164985 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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]