mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
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.
This commit is contained in:
parent
19d26dde92
commit
afb41f715b
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user