window/x11: Add function to convert the surface to client area
Add a convenient function to get the client area rectangle from a given surface rectangle. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
This commit is contained in:
parent
adc38f902a
commit
be11525b28
@ -4092,3 +4092,19 @@ meta_window_x11_buffer_rect_to_frame_rect (MetaWindow *window,
|
||||
frame_rect->width -= borders.invisible.left + borders.invisible.right;
|
||||
frame_rect->height -= borders.invisible.top + borders.invisible.bottom;
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_x11_surface_rect_to_client_rect (MetaWindow *window,
|
||||
MetaRectangle *surface_rect,
|
||||
MetaRectangle *client_rect)
|
||||
{
|
||||
MetaFrameBorders borders;
|
||||
|
||||
meta_frame_calc_borders (window->frame, &borders);
|
||||
|
||||
*client_rect = *surface_rect;
|
||||
client_rect->x += borders.total.left;
|
||||
client_rect->y += borders.total.top;
|
||||
client_rect->width -= borders.total.left + borders.total.right;
|
||||
client_rect->height -= borders.total.top + borders.total.bottom;
|
||||
}
|
||||
|
@ -92,5 +92,7 @@ gboolean meta_window_x11_always_update_shape (MetaWindow *window);
|
||||
void meta_window_x11_buffer_rect_to_frame_rect (MetaWindow *window,
|
||||
MetaRectangle *buffer_rect,
|
||||
MetaRectangle *frame_rect);
|
||||
|
||||
void meta_window_x11_surface_rect_to_client_rect (MetaWindow *window,
|
||||
MetaRectangle *surface_rect,
|
||||
MetaRectangle *client_rect);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user