window: Save the buffer_rect internally

Rather than calculate it speculatively with the current properties
which may be too new or too out of date, make sure it always fits
with the proper definition. We update it when we update the toplevel
window for X11, and when a Wayland surface is committed with a newly
attached buffer.
This commit is contained in:
Jasper St. Pierre
2014-06-17 11:03:29 -04:00
parent 188e4e1b92
commit b0b8f37240
4 changed files with 19 additions and 18 deletions

View File

@ -4052,24 +4052,7 @@ void
meta_window_get_buffer_rect (const MetaWindow *window,
MetaRectangle *rect)
{
if (window->frame)
*rect = window->frame->rect;
else if (window->xwindow != None)
{
XWindowAttributes xwa;
XGetWindowAttributes (window->display->xdisplay, window->xwindow, &xwa);
rect->x = xwa.x;
rect->y = xwa.y;
rect->width = xwa.width;
rect->height = xwa.height;
}
else
{
*rect = window->rect;
meta_window_frame_rect_to_client_rect ((MetaWindow *) window, rect, rect);
}
*rect = window->buffer_rect;
}
/**