[mutter] core: Convert GET_FRAME_WIDTH / GET_FRAME_HEIGHT to GET_FRAME_RECT
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] core: Convert GET_FRAME_WIDTH / GET_FRAME_HEIGHT to GET_FRAME_RECT
- Date: Tue, 27 May 2014 19:45:22 +0000 (UTC)
commit 19d26dde92a9adc58bb1898740f3b844d1a83589
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun May 25 08:16:47 2014 -0400
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, ...)
src/core/core.c | 7 ++-----
src/core/core.h | 3 +--
src/ui/frames.c | 9 ++++-----
3 files changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/src/core/core.c b/src/core/core.c
index 6eed661..fc0f870 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -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;
diff --git a/src/core/core.h b/src/core/core.h
index c6df0e0..ecbe425 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -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;
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 9de29f4..9066ef1 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]