[mutter] core: Make META_CORE_GET_FRAME_RECT return the "frame rect"
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] core: Make META_CORE_GET_FRAME_RECT return the "frame rect"
- Date: Tue, 27 May 2014 19:45:27 +0000 (UTC)
commit afb41f715b35e78e1ec43e45ac32617d6b5cd592
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun May 25 08:22:24 2014 -0400
core: Make META_CORE_GET_FRAME_RECT return the "frame rect"
We have two different coordinate spaces here. One is the rectangle
returned by meta_window_get_frame_rect, which is called the "frame
rect" or "the window geometry", which includes visible frame borders
but not invisible frame borders. The other is "frame->rect" which
corresponds to the frame's server geometry. That is, it includes
both visible and invisible frame borders.
These two were of course the same until we introduced invisible
frame borders, and an executive decision was made to make
meta_window_get_frame_rect return the rectangle bounding the
visible portions of the frame.
As time went on, the "frame rect" turned out to be more useful when
making decisions upon, since the user often doesn't think about the
invisible window geometry as part of the window.
We already calculate what amounts to the "frame rect" in the theme
code, so just change META_CORE_GET_FRAME_RECT to consume that
directly.
src/core/core.c | 2 +-
src/ui/frames.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/core/core.c b/src/core/core.c
index fc0f870..4c7d5dd 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -121,7 +121,7 @@ meta_core_get (Display *xdisplay,
*((GdkPixbuf**)answer) = window->icon;
break;
case META_CORE_GET_FRAME_RECT:
- *((MetaRectangle*)answer) = window->frame->rect;
+ meta_window_get_frame_rect (window, ((MetaRectangle*)answer));
break;
case META_CORE_GET_THEME_VARIANT:
*((char**)answer) = window->gtk_theme_variant;
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 9066ef1..aaa3908 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -1624,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_rect.width - borders.invisible.left - borders.invisible.right;
- area.height = frame_rect.height - borders.invisible.top - borders.invisible.bottom;
+ area.width = frame_rect.width;
+ area.height = frame_rect.height;
frame_border = cairo_region_create_rectangle (&area);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]