diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-07-14 16:28:48 -0400 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2014-07-17 13:58:45 -0700 |
commit | bd65e508753b8c1eeadcaa1c223bace2a3477083 (patch) | |
tree | 08c553f795646a20a4c16fe36d2e09e1478f4905 /clients/window.c | |
parent | 7b9820766735f3b5184e9795d7945dcdd784a827 (diff) | |
download | weston-bd65e508753b8c1eeadcaa1c223bace2a3477083.tar.gz |
Interpret the size in the configure event as window geometry
The size of the configure event has always been specified as in window
geometry coordinates, but it was never implemented this way.
Diffstat (limited to 'clients/window.c')
-rw-r--r-- | clients/window.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/clients/window.c b/clients/window.c index b82a93eb..f44bf643 100644 --- a/clients/window.c +++ b/clients/window.c @@ -3787,6 +3787,15 @@ widget_schedule_resize(struct widget *widget, int32_t width, int32_t height) window_schedule_resize(widget->window, width, height); } +static int +window_get_shadow_margin(struct window *window) +{ + if (window->frame) + return frame_get_shadow_margin(window->frame->frame); + else + return 0; +} + static void handle_surface_configure(void *data, struct xdg_surface *xdg_surface, int32_t width, int32_t height, @@ -3836,7 +3845,14 @@ handle_surface_configure(void *data, struct xdg_surface *xdg_surface, } if (width > 0 && height > 0) { - window_schedule_resize(window, width, height); + /* The width / height params are for window geometry, + * but window_schedule_resize takes allocation. Add + * on the shadow margin to get the difference. */ + int margin = window_get_shadow_margin(window); + + window_schedule_resize(window, + width + margin * 2, + height + margin * 2); } else { window_schedule_resize(window, window->saved_allocation.width, |