core: Convert GET_FRAME_WIDTH / GET_FRAME_HEIGHT to GET_FRAME_RECT

Since we're going to be calling meta_window_get_frame_rect in here
soon, I'd rather it be one method call, rather than two. We can't
put it at the toplevel, since that might cause infinite recursion
(e.g. meta_core_get calls meta_window_get_frame_rect calls
meta_ui_get_frame_borders calls meta_core_get, ...)
This commit is contained in:
Jasper St. Pierre 2014-05-25 08:16:47 -04:00
parent 4acb902423
commit 19d26dde92
3 changed files with 7 additions and 12 deletions

View File

@ -120,11 +120,8 @@ meta_core_get (Display *xdisplay,
case META_CORE_GET_ICON:
*((GdkPixbuf**)answer) = window->icon;
break;
case META_CORE_GET_FRAME_WIDTH:
*((gint*)answer) = window->frame->rect.width;
break;
case META_CORE_GET_FRAME_HEIGHT:
*((gint*)answer) = window->frame->rect.height;
case META_CORE_GET_FRAME_RECT:
*((MetaRectangle*)answer) = window->frame->rect;
break;
case META_CORE_GET_THEME_VARIANT:
*((char**)answer) = window->gtk_theme_variant;

View File

@ -37,8 +37,7 @@ typedef enum
META_CORE_GET_FRAME_TYPE,
META_CORE_GET_MINI_ICON,
META_CORE_GET_ICON,
META_CORE_GET_FRAME_WIDTH,
META_CORE_GET_FRAME_HEIGHT,
META_CORE_GET_FRAME_RECT,
META_CORE_GET_THEME_VARIANT,
} MetaCoreGetType;

View File

@ -1601,21 +1601,20 @@ static void
clip_region_to_visible_frame_border (cairo_region_t *region,
MetaUIFrame *frame)
{
MetaRectangle frame_rect;
cairo_rectangle_int_t area;
cairo_region_t *frame_border;
MetaFrameFlags flags;
MetaFrameType type;
MetaFrameBorders borders;
Display *display;
int frame_width, frame_height;
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
meta_core_get (display, frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_FRAME_TYPE, &type,
META_CORE_GET_FRAME_WIDTH, &frame_width,
META_CORE_GET_FRAME_HEIGHT, &frame_height,
META_CORE_GET_FRAME_RECT, &frame_rect,
META_CORE_GET_END);
meta_theme_get_frame_borders (meta_theme_get_current (),
@ -1625,8 +1624,8 @@ clip_region_to_visible_frame_border (cairo_region_t *region,
/* Visible frame rect */
area.x = borders.invisible.left;
area.y = borders.invisible.top;
area.width = frame_width - borders.invisible.left - borders.invisible.right;
area.height = frame_height - borders.invisible.top - borders.invisible.bottom;
area.width = frame_rect.width - borders.invisible.left - borders.invisible.right;
area.height = frame_rect.height - borders.invisible.top - borders.invisible.bottom;
frame_border = cairo_region_create_rectangle (&area);