mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
Let the UI layer (via the core) construct the frame mask
This essentially just moves install_corners() from the compositor, through the core, into the UI layer where it arguably should have been anyway, leaving behind stub functions which call through the various layers. This removes the compositor's special knowledge of how rounded corners work, replacing it with "ask the UI for an alpha mask". The computation of border widths and heights changes a bit, because the width and height used in install_corners() are the meta_window_get_outer_rect() (which includes the visible borders but not the invisible ones), whereas the more readily-available rectangle is the MetaFrame.rect (which includes both). Computing the same width and height as meta_window_get_outer_rect() involves compensating for the invisible borders, but the UI layer is the authority on those anyway, so it seems clearer to have it do the calculations from scratch. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=697758 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
This commit is contained in:
@ -332,19 +332,6 @@ meta_frame_calc_borders (MetaFrame *frame,
|
||||
borders);
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_get_corner_radiuses (MetaFrame *frame,
|
||||
float *top_left,
|
||||
float *top_right,
|
||||
float *bottom_left,
|
||||
float *bottom_right)
|
||||
{
|
||||
meta_ui_get_corner_radiuses (frame->window->screen->ui,
|
||||
frame->xwindow,
|
||||
top_left, top_right,
|
||||
bottom_left, bottom_right);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_frame_sync_to_window (MetaFrame *frame,
|
||||
int resize_gravity,
|
||||
@ -400,6 +387,14 @@ meta_frame_get_frame_bounds (MetaFrame *frame)
|
||||
frame->rect.height);
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_get_mask (MetaFrame *frame,
|
||||
cairo_t *cr)
|
||||
{
|
||||
meta_ui_get_frame_mask (frame->window->screen->ui, frame->xwindow,
|
||||
frame->rect.width, frame->rect.height, cr);
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_queue_draw (MetaFrame *frame)
|
||||
{
|
||||
|
@ -63,12 +63,6 @@ Window meta_frame_get_xwindow (MetaFrame *frame);
|
||||
void meta_frame_calc_borders (MetaFrame *frame,
|
||||
MetaFrameBorders *borders);
|
||||
|
||||
void meta_frame_get_corner_radiuses (MetaFrame *frame,
|
||||
float *top_left,
|
||||
float *top_right,
|
||||
float *bottom_left,
|
||||
float *bottom_right);
|
||||
|
||||
gboolean meta_frame_sync_to_window (MetaFrame *frame,
|
||||
int gravity,
|
||||
gboolean need_move,
|
||||
@ -76,6 +70,9 @@ gboolean meta_frame_sync_to_window (MetaFrame *frame,
|
||||
|
||||
cairo_region_t *meta_frame_get_frame_bounds (MetaFrame *frame);
|
||||
|
||||
void meta_frame_get_mask (MetaFrame *frame,
|
||||
cairo_t *cr);
|
||||
|
||||
void meta_frame_set_screen_cursor (MetaFrame *frame,
|
||||
MetaCursor cursor);
|
||||
|
||||
|
Reference in New Issue
Block a user