mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
window/x11: Add function to convert the buffer to frame rect
Add a convenient function to get the frame rectangle from a given buffer. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1009
This commit is contained in:
parent
c0321c7b21
commit
1000ebe203
@ -4066,3 +4066,22 @@ meta_window_x11_always_update_shape (MetaWindow *window)
|
|||||||
|
|
||||||
return META_WINDOW_X11_GET_CLASS (window_x11)->always_update_shape (window);
|
return META_WINDOW_X11_GET_CLASS (window_x11)->always_update_shape (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_window_x11_buffer_rect_to_frame_rect (MetaWindow *window,
|
||||||
|
MetaRectangle *buffer_rect,
|
||||||
|
MetaRectangle *frame_rect)
|
||||||
|
|
||||||
|
{
|
||||||
|
MetaFrameBorders borders;
|
||||||
|
|
||||||
|
g_return_if_fail (window->frame);
|
||||||
|
|
||||||
|
meta_frame_calc_borders (window->frame, &borders);
|
||||||
|
|
||||||
|
*frame_rect = *buffer_rect;
|
||||||
|
frame_rect->x += borders.invisible.left;
|
||||||
|
frame_rect->y += borders.invisible.top;
|
||||||
|
frame_rect->width -= borders.invisible.left + borders.invisible.right;
|
||||||
|
frame_rect->height -= borders.invisible.top + borders.invisible.bottom;
|
||||||
|
}
|
||||||
|
@ -89,4 +89,8 @@ void meta_window_x11_set_thaw_after_paint (MetaWindow *window,
|
|||||||
gboolean meta_window_x11_should_thaw_after_paint (MetaWindow *window);
|
gboolean meta_window_x11_should_thaw_after_paint (MetaWindow *window);
|
||||||
gboolean meta_window_x11_always_update_shape (MetaWindow *window);
|
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);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user