Rename meta_window_get_outer_rect() to meta_window_get_frame_rect()

For clarity, rename meta_window_get_outer_rect() to match terminology
we use elsewhere. The old function is left as a deprecated
compatibility wrapper.
This commit is contained in:
Owen W. Taylor 2013-11-19 12:24:45 -05:00
parent 097ee776c7
commit b9da43b753
13 changed files with 124 additions and 101 deletions

View File

@ -541,6 +541,7 @@ meta_window_is_override_redirect
meta_window_is_skip_taskbar meta_window_is_skip_taskbar
meta_window_get_rect meta_window_get_rect
meta_window_get_input_rect meta_window_get_input_rect
meta_window_get_frame_rect
meta_window_get_outer_rect meta_window_get_outer_rect
meta_window_client_rect_to_frame_rect meta_window_client_rect_to_frame_rect
meta_window_frame_rect_to_client_rect meta_window_frame_rect_to_client_rect

View File

@ -864,7 +864,7 @@ meta_shape_cow_for_window (MetaScreen *screen,
int width, height; int width, height;
MetaRectangle rect; MetaRectangle rect;
meta_window_get_outer_rect (metaWindow, &rect); meta_window_get_frame_rect (metaWindow, &rect);
window_bounds.x = rect.x; window_bounds.x = rect.x;
window_bounds.y = rect.y; window_bounds.y = rect.y;

View File

@ -2031,7 +2031,7 @@ check_needs_x11_pixmap (MetaWindowActor *self)
meta_surface_actor_set_texture (META_SURFACE_ACTOR (priv->surface), texture); meta_surface_actor_set_texture (META_SURFACE_ACTOR (priv->surface), texture);
/* ::size-changed is supposed to refer to meta_window_get_outer_rect(). /* ::size-changed is supposed to refer to meta_window_get_frame_rect().
* Emitting it here works pretty much OK because a new value of the * Emitting it here works pretty much OK because a new value of the
* *input* rect (which is the outer rect with the addition of invisible * *input* rect (which is the outer rect with the addition of invisible
* borders) forces a new pixmap and we get here. In the rare case where * borders) forces a new pixmap and we get here. In the rare case where
@ -2128,7 +2128,7 @@ meta_window_actor_process_x11_damage (MetaWindowActor *self,
if (meta_window_is_fullscreen (priv->window) && g_list_last (info->windows)->data == self && !priv->unredirected) if (meta_window_is_fullscreen (priv->window) && g_list_last (info->windows)->data == self && !priv->unredirected)
{ {
MetaRectangle window_rect; MetaRectangle window_rect;
meta_window_get_outer_rect (priv->window, &window_rect); meta_window_get_frame_rect (priv->window, &window_rect);
if (window_rect.x == event->area.x && if (window_rect.x == event->area.x &&
window_rect.y == event->area.y && window_rect.y == event->area.y &&

View File

@ -163,7 +163,7 @@ meta_window_group_paint (ClutterActor *actor)
cairo_rectangle_int_t unredirected_rect; cairo_rectangle_int_t unredirected_rect;
MetaWindow *window = meta_window_actor_get_meta_window (info->unredirected_window); MetaWindow *window = meta_window_actor_get_meta_window (info->unredirected_window);
meta_window_get_outer_rect (window, (MetaRectangle *)&unredirected_rect); meta_window_get_frame_rect (window, (MetaRectangle *)&unredirected_rect);
cairo_region_subtract_rectangle (unobscured_region, &unredirected_rect); cairo_region_subtract_rectangle (unobscured_region, &unredirected_rect);
cairo_region_subtract_rectangle (clip_region, &unredirected_rect); cairo_region_subtract_rectangle (clip_region, &unredirected_rect);
} }

View File

@ -497,7 +497,7 @@ place_window_if_needed(MetaWindow *window,
MetaWorkspace *cur_workspace; MetaWorkspace *cur_workspace;
const MetaMonitorInfo *monitor_info; const MetaMonitorInfo *monitor_info;
meta_window_get_outer_rect (window, &placed_rect); meta_window_get_frame_rect (window, &placed_rect);
meta_window_place (window, info->orig.x, info->orig.y, meta_window_place (window, info->orig.x, info->orig.y,
&placed_rect.x, &placed_rect.y); &placed_rect.x, &placed_rect.y);
did_placement = TRUE; did_placement = TRUE;
@ -707,8 +707,8 @@ get_size_limits (MetaWindow *window,
if (include_frame) if (include_frame)
{ {
meta_window_client_rect_to_outer_rect (window, min_size, min_size); meta_window_client_rect_to_frame_rect (window, min_size, min_size);
meta_window_client_rect_to_outer_rect (window, max_size, max_size); meta_window_client_rect_to_frame_rect (window, max_size, max_size);
} }
} }
@ -735,7 +735,7 @@ constrain_modal_dialog (MetaWindow *window,
child_rect = info->current; child_rect = info->current;
extend_by_frame (window, &child_rect); extend_by_frame (window, &child_rect);
meta_window_get_outer_rect (parent, &parent_rect); meta_window_get_frame_rect (parent, &parent_rect);
child_rect.x = parent_rect.x + (parent_rect.width / 2 - child_rect.width / 2); child_rect.x = parent_rect.x + (parent_rect.width / 2 - child_rect.width / 2);
child_rect.y = parent_rect.y + (parent_rect.height / 2 - child_rect.height / 2); child_rect.y = parent_rect.y + (parent_rect.height / 2 - child_rect.height / 2);

View File

@ -1619,7 +1619,7 @@ window_raise_with_delay_callback (void *data)
&root_x, &root_y, &x, &y, &mask); &root_x, &root_y, &x, &y, &mask);
meta_error_trap_pop (window->display); meta_error_trap_pop (window->display);
meta_window_get_outer_rect (window, &frame_rect); meta_window_get_frame_rect (window, &frame_rect);
point_in_window = POINT_IN_RECT (root_x, root_y, frame_rect); point_in_window = POINT_IN_RECT (root_x, root_y, frame_rect);
if (same_screen && point_in_window) if (same_screen && point_in_window)
meta_window_raise (window); meta_window_raise (window);
@ -2177,7 +2177,7 @@ meta_display_handle_event (MetaDisplay *display,
int root_x, root_y; int root_x, root_y;
MetaGrabOp op; MetaGrabOp op;
meta_window_get_outer_rect (window, &frame_rect); meta_window_get_frame_rect (window, &frame_rect);
west = event->button.x < (frame_rect.x + 1 * frame_rect.width / 3); west = event->button.x < (frame_rect.x + 1 * frame_rect.width / 3);
east = event->button.x > (frame_rect.x + 2 * frame_rect.width / 3); east = event->button.x > (frame_rect.x + 2 * frame_rect.width / 3);

View File

@ -985,7 +985,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
{ {
MetaRectangle *new_rect; MetaRectangle *new_rect;
new_rect = g_new (MetaRectangle, 1); new_rect = g_new (MetaRectangle, 1);
meta_window_get_outer_rect (cur_window, new_rect); meta_window_get_frame_rect (cur_window, new_rect);
obscuring_windows = g_slist_prepend (obscuring_windows, new_rect); obscuring_windows = g_slist_prepend (obscuring_windows, new_rect);
window_stacking = window_stacking =
g_slist_prepend (window_stacking, GINT_TO_POINTER (stack_position)); g_slist_prepend (window_stacking, GINT_TO_POINTER (stack_position));
@ -1010,7 +1010,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
{ {
MetaRectangle cur_rect; MetaRectangle cur_rect;
MetaWindow *cur_window = cur_window_iter->data; MetaWindow *cur_window = cur_window_iter->data;
meta_window_get_outer_rect (cur_window, &cur_rect); meta_window_get_frame_rect (cur_window, &cur_rect);
/* Check if we want to use this window's edges for edge /* Check if we want to use this window's edges for edge
* resistance (note that dock edges are considered screen edges * resistance (note that dock edges are considered screen edges
@ -1151,7 +1151,7 @@ meta_window_edge_resistance_for_move (MetaWindow *window,
MetaRectangle old_outer, proposed_outer, new_outer; MetaRectangle old_outer, proposed_outer, new_outer;
gboolean is_resize; gboolean is_resize;
meta_window_get_outer_rect (window, &old_outer); meta_window_get_frame_rect (window, &old_outer);
proposed_outer = old_outer; proposed_outer = old_outer;
proposed_outer.x += (*new_x - old_x); proposed_outer.x += (*new_x - old_x);
@ -1237,7 +1237,7 @@ meta_window_edge_resistance_for_resize (MetaWindow *window,
int proposed_outer_width, proposed_outer_height; int proposed_outer_width, proposed_outer_height;
gboolean is_resize; gboolean is_resize;
meta_window_get_outer_rect (window, &old_outer); meta_window_get_frame_rect (window, &old_outer);
proposed_outer_width = old_outer.width + (*new_width - old_width); proposed_outer_width = old_outer.width + (*new_width - old_width);
proposed_outer_height = old_outer.height + (*new_height - old_height); proposed_outer_height = old_outer.height + (*new_height - old_height);
meta_rectangle_resize_with_gravity (&old_outer, meta_rectangle_resize_with_gravity (&old_outer,

View File

@ -3125,17 +3125,17 @@ handle_move_to_corner_backend (MetaDisplay *display,
gpointer dummy) gpointer dummy)
{ {
MetaRectangle work_area; MetaRectangle work_area;
MetaRectangle outer; MetaRectangle frame_rect;
int orig_x, orig_y; int orig_x, orig_y;
int new_x, new_y; int new_x, new_y;
meta_window_get_work_area_all_monitors (window, &work_area); meta_window_get_work_area_all_monitors (window, &work_area);
meta_window_get_outer_rect (window, &outer); meta_window_get_frame_rect (window, &frame_rect);
meta_window_get_position (window, &orig_x, &orig_y); meta_window_get_position (window, &orig_x, &orig_y);
if (xchange) { if (xchange) {
new_x = work_area.x + (to_right ? new_x = work_area.x + (to_right ?
work_area.width - outer.width : work_area.width - frame_rect.width :
0); 0);
} else { } else {
new_x = orig_x; new_x = orig_x;
@ -3143,7 +3143,7 @@ handle_move_to_corner_backend (MetaDisplay *display,
if (ychange) { if (ychange) {
new_y = work_area.y + (to_bottom ? new_y = work_area.y + (to_bottom ?
work_area.height - outer.height : work_area.height - frame_rect.height :
0); 0);
} else { } else {
new_y = orig_y; new_y = orig_y;
@ -3252,12 +3252,12 @@ handle_move_to_center (MetaDisplay *display,
gpointer dummy) gpointer dummy)
{ {
MetaRectangle work_area; MetaRectangle work_area;
MetaRectangle outer; MetaRectangle frame_rect;
int orig_x, orig_y; int orig_x, orig_y;
int frame_width, frame_height; int frame_width, frame_height;
meta_window_get_work_area_all_monitors (window, &work_area); meta_window_get_work_area_all_monitors (window, &work_area);
meta_window_get_outer_rect (window, &outer); meta_window_get_frame_rect (window, &frame_rect);
meta_window_get_position (window, &orig_x, &orig_y); meta_window_get_position (window, &orig_x, &orig_y);
frame_width = (window->frame ? window->frame->child_x : 0); frame_width = (window->frame ? window->frame->child_x : 0);
@ -3265,8 +3265,8 @@ handle_move_to_center (MetaDisplay *display,
meta_window_move_resize (window, meta_window_move_resize (window,
TRUE, TRUE,
work_area.x + (work_area.width +frame_width -outer.width )/2, work_area.x + (work_area.width +frame_width -frame_rect.width )/2,
work_area.y + (work_area.height+frame_height-outer.height)/2, work_area.y + (work_area.height+frame_height-frame_rect.height)/2,
window->rect.width, window->rect.width,
window->rect.height); window->rect.height);
} }
@ -3958,8 +3958,8 @@ handle_raise_or_lower (MetaDisplay *display,
if (above->mapped) if (above->mapped)
{ {
meta_window_get_outer_rect (window, &win_rect); meta_window_get_frame_rect (window, &win_rect);
meta_window_get_outer_rect (above, &above_rect); meta_window_get_frame_rect (above, &above_rect);
/* Check if obscured */ /* Check if obscured */
if (meta_rectangle_intersect (&win_rect, &above_rect, &tmp)) if (meta_rectangle_intersect (&win_rect, &above_rect, &tmp))

View File

@ -53,8 +53,8 @@ northwestcmp (gconstpointer a, gconstpointer b)
int from_origin_b; int from_origin_b;
int ax, ay, bx, by; int ax, ay, bx, by;
meta_window_get_outer_rect (aw, &a_frame); meta_window_get_frame_rect (aw, &a_frame);
meta_window_get_outer_rect (bw, &b_frame); meta_window_get_frame_rect (bw, &b_frame);
ax = a_frame.x; ax = a_frame.x;
ay = a_frame.y; ay = a_frame.y;
bx = b_frame.x; bx = b_frame.x;
@ -131,7 +131,7 @@ find_next_cascade (MetaWindow *window,
/* Find first cascade position that's not used. */ /* Find first cascade position that's not used. */
meta_window_get_outer_rect (window, &frame_rect); meta_window_get_frame_rect (window, &frame_rect);
window_width = frame_rect.width; window_width = frame_rect.width;
window_height = frame_rect.height; window_height = frame_rect.height;
@ -146,7 +146,7 @@ find_next_cascade (MetaWindow *window,
w = tmp->data; w = tmp->data;
/* we want frame position, not window position */ /* we want frame position, not window position */
meta_window_get_outer_rect (w, &w_frame_rect); meta_window_get_frame_rect (w, &w_frame_rect);
wx = w_frame_rect.x; wx = w_frame_rect.x;
wy = w_frame_rect.y; wy = w_frame_rect.y;
@ -224,23 +224,23 @@ find_most_freespace (MetaWindow *window,
int left_space, right_space, top_space, bottom_space; int left_space, right_space, top_space, bottom_space;
MetaRectangle work_area; MetaRectangle work_area;
MetaRectangle avoid; MetaRectangle avoid;
MetaRectangle outer; MetaRectangle frame_rect;
meta_window_get_work_area_current_monitor (focus_window, &work_area); meta_window_get_work_area_current_monitor (focus_window, &work_area);
meta_window_get_outer_rect (focus_window, &avoid); meta_window_get_frame_rect (focus_window, &avoid);
meta_window_get_outer_rect (window, &outer); meta_window_get_frame_rect (window, &frame_rect);
/* Find the areas of choosing the various sides of the focus window */ /* Find the areas of choosing the various sides of the focus window */
max_width = MIN (avoid.width, outer.width); max_width = MIN (avoid.width, frame_rect.width);
max_height = MIN (avoid.height, outer.height); max_height = MIN (avoid.height, frame_rect.height);
left_space = avoid.x - work_area.x; left_space = avoid.x - work_area.x;
right_space = work_area.width - (avoid.x + avoid.width - work_area.x); right_space = work_area.width - (avoid.x + avoid.width - work_area.x);
top_space = avoid.y - work_area.y; top_space = avoid.y - work_area.y;
bottom_space = work_area.height - (avoid.y + avoid.height - work_area.y); bottom_space = work_area.height - (avoid.y + avoid.height - work_area.y);
left = MIN (left_space, outer.width); left = MIN (left_space, frame_rect.width);
right = MIN (right_space, outer.width); right = MIN (right_space, frame_rect.width);
top = MIN (top_space, outer.height); top = MIN (top_space, frame_rect.height);
bottom = MIN (bottom_space, outer.height); bottom = MIN (bottom_space, frame_rect.height);
/* Find out which side of the focus_window can show the most of the window */ /* Find out which side of the focus_window can show the most of the window */
side = META_LEFT; side = META_LEFT;
@ -273,31 +273,31 @@ find_most_freespace (MetaWindow *window,
{ {
case META_LEFT: case META_LEFT:
*new_y = avoid.y; *new_y = avoid.y;
if (left_space > outer.width) if (left_space > frame_rect.width)
*new_x = avoid.x - outer.width; *new_x = avoid.x - frame_rect.width;
else else
*new_x = work_area.x; *new_x = work_area.x;
break; break;
case META_RIGHT: case META_RIGHT:
*new_y = avoid.y; *new_y = avoid.y;
if (right_space > outer.width) if (right_space > frame_rect.width)
*new_x = avoid.x + avoid.width; *new_x = avoid.x + avoid.width;
else else
*new_x = work_area.x + work_area.width - outer.width; *new_x = work_area.x + work_area.width - frame_rect.width;
break; break;
case META_TOP: case META_TOP:
*new_x = avoid.x; *new_x = avoid.x;
if (top_space > outer.height) if (top_space > frame_rect.height)
*new_y = avoid.y - outer.height; *new_y = avoid.y - frame_rect.height;
else else
*new_y = work_area.y; *new_y = work_area.y;
break; break;
case META_BOTTOM: case META_BOTTOM:
*new_x = avoid.x; *new_x = avoid.x;
if (bottom_space > outer.height) if (bottom_space > frame_rect.height)
*new_y = avoid.y + avoid.height; *new_y = avoid.y + avoid.height;
else else
*new_y = work_area.y + work_area.height - outer.height; *new_y = work_area.y + work_area.height - frame_rect.height;
break; break;
} }
} }
@ -312,8 +312,8 @@ window_overlaps_focus_window (MetaWindow *window)
if (focus_window == NULL) if (focus_window == NULL)
return FALSE; return FALSE;
meta_window_get_outer_rect (window, &window_frame); meta_window_get_frame_rect (window, &window_frame);
meta_window_get_outer_rect (focus_window, &focus_frame); meta_window_get_frame_rect (focus_window, &focus_frame);
return meta_rectangle_intersect (&window_frame, return meta_rectangle_intersect (&window_frame,
&focus_frame, &focus_frame,
@ -393,7 +393,7 @@ rectangle_overlaps_some_window (MetaRectangle *rect,
case META_WINDOW_UTILITY: case META_WINDOW_UTILITY:
case META_WINDOW_TOOLBAR: case META_WINDOW_TOOLBAR:
case META_WINDOW_MENU: case META_WINDOW_MENU:
meta_window_get_outer_rect (other, &other_rect); meta_window_get_frame_rect (other, &other_rect);
if (meta_rectangle_intersect (rect, &other_rect, &dest)) if (meta_rectangle_intersect (rect, &other_rect, &dest))
return TRUE; return TRUE;
@ -415,8 +415,8 @@ leftmost_cmp (gconstpointer a, gconstpointer b)
MetaRectangle b_frame; MetaRectangle b_frame;
int ax, bx; int ax, bx;
meta_window_get_outer_rect (aw, &a_frame); meta_window_get_frame_rect (aw, &a_frame);
meta_window_get_outer_rect (bw, &b_frame); meta_window_get_frame_rect (bw, &b_frame);
ax = a_frame.x; ax = a_frame.x;
bx = b_frame.x; bx = b_frame.x;
@ -437,8 +437,8 @@ topmost_cmp (gconstpointer a, gconstpointer b)
MetaRectangle b_frame; MetaRectangle b_frame;
int ay, by; int ay, by;
meta_window_get_outer_rect (aw, &a_frame); meta_window_get_frame_rect (aw, &a_frame);
meta_window_get_outer_rect (bw, &b_frame); meta_window_get_frame_rect (bw, &b_frame);
ay = a_frame.y; ay = a_frame.y;
by = b_frame.y; by = b_frame.y;
@ -512,7 +512,7 @@ find_first_fit (MetaWindow *window,
right_sorted = g_list_sort (right_sorted, topmost_cmp); right_sorted = g_list_sort (right_sorted, topmost_cmp);
right_sorted = g_list_sort (right_sorted, leftmost_cmp); right_sorted = g_list_sort (right_sorted, leftmost_cmp);
meta_window_get_outer_rect (window, &rect); meta_window_get_frame_rect (window, &rect);
#ifdef WITH_VERBOSE_MODE #ifdef WITH_VERBOSE_MODE
{ {
@ -545,12 +545,12 @@ find_first_fit (MetaWindow *window,
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *w = tmp->data; MetaWindow *w = tmp->data;
MetaRectangle outer_rect; MetaRectangle frame_rect;
meta_window_get_outer_rect (w, &outer_rect); meta_window_get_frame_rect (w, &frame_rect);
rect.x = outer_rect.x; rect.x = frame_rect.x;
rect.y = outer_rect.y + outer_rect.height; rect.y = frame_rect.y + frame_rect.height;
if (meta_rectangle_contains_rect (&work_area, &rect) && if (meta_rectangle_contains_rect (&work_area, &rect) &&
!rectangle_overlaps_some_window (&rect, below_sorted)) !rectangle_overlaps_some_window (&rect, below_sorted))
@ -571,12 +571,12 @@ find_first_fit (MetaWindow *window,
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *w = tmp->data; MetaWindow *w = tmp->data;
MetaRectangle outer_rect; MetaRectangle frame_rect;
meta_window_get_outer_rect (w, &outer_rect); meta_window_get_frame_rect (w, &frame_rect);
rect.x = outer_rect.x + outer_rect.width; rect.x = frame_rect.x + frame_rect.width;
rect.y = outer_rect.y; rect.y = frame_rect.y;
if (meta_rectangle_contains_rect (&work_area, &rect) && if (meta_rectangle_contains_rect (&work_area, &rect) &&
!rectangle_overlaps_some_window (&rect, right_sorted)) !rectangle_overlaps_some_window (&rect, right_sorted))
@ -718,8 +718,8 @@ meta_window_place (MetaWindow *window,
{ {
MetaRectangle frame_rect, parent_frame_rect; MetaRectangle frame_rect, parent_frame_rect;
meta_window_get_outer_rect (window, &frame_rect); meta_window_get_frame_rect (window, &frame_rect);
meta_window_get_outer_rect (parent, &parent_frame_rect); meta_window_get_frame_rect (parent, &parent_frame_rect);
y = parent_frame_rect.y; y = parent_frame_rect.y;
@ -754,7 +754,7 @@ meta_window_place (MetaWindow *window,
int w, h; int w, h;
MetaRectangle frame_rect; MetaRectangle frame_rect;
meta_window_get_outer_rect (window, &frame_rect); meta_window_get_frame_rect (window, &frame_rect);
/* Warning, this function is a round trip! */ /* Warning, this function is a round trip! */
xi = meta_screen_get_current_monitor_info (window->screen); xi = meta_screen_get_current_monitor_info (window->screen);
@ -820,17 +820,17 @@ meta_window_place (MetaWindow *window,
!window->fullscreen) !window->fullscreen)
{ {
MetaRectangle workarea; MetaRectangle workarea;
MetaRectangle outer; MetaRectangle frame_rect;
meta_window_get_work_area_for_monitor (window, meta_window_get_work_area_for_monitor (window,
xi->number, xi->number,
&workarea); &workarea);
meta_window_get_outer_rect (window, &outer); meta_window_get_frame_rect (window, &frame_rect);
/* If the window is bigger than the screen, then automaximize. Do NOT /* If the window is bigger than the screen, then automaximize. Do NOT
* auto-maximize the directions independently. See #419810. * auto-maximize the directions independently. See #419810.
*/ */
if (outer.width >= workarea.width && outer.height >= workarea.height) if (frame_rect.width >= workarea.width && frame_rect.height >= workarea.height)
{ {
window->maximize_horizontally_after_placement = TRUE; window->maximize_horizontally_after_placement = TRUE;
window->maximize_vertically_after_placement = TRUE; window->maximize_vertically_after_placement = TRUE;

View File

@ -1528,7 +1528,7 @@ meta_screen_tab_popup_create (MetaScreen *screen,
if (show_type == META_TAB_SHOW_INSTANTLY || if (show_type == META_TAB_SHOW_INSTANTLY ||
!entries[i].hidden || !entries[i].hidden ||
!meta_window_get_icon_geometry (window, &r)) !meta_window_get_icon_geometry (window, &r))
meta_window_get_outer_rect (window, &r); meta_window_get_frame_rect (window, &r);
entries[i].rect = r; entries[i].rect = r;
@ -1914,7 +1914,7 @@ meta_screen_get_monitor_for_window (MetaScreen *screen,
{ {
MetaRectangle window_rect; MetaRectangle window_rect;
meta_window_get_outer_rect (window, &window_rect); meta_window_get_frame_rect (window, &window_rect);
return meta_screen_get_monitor_for_rect (screen, &window_rect); return meta_screen_get_monitor_for_rect (screen, &window_rect);
} }

View File

@ -1693,7 +1693,7 @@ window_contains_point (MetaWindow *window,
{ {
MetaRectangle rect; MetaRectangle rect;
meta_window_get_outer_rect (window, &rect); meta_window_get_frame_rect (window, &rect);
return POINT_IN_RECT (root_x, root_y, rect); return POINT_IN_RECT (root_x, root_y, rect);
} }

View File

@ -2931,8 +2931,8 @@ static gboolean
windows_overlap (const MetaWindow *w1, const MetaWindow *w2) windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
{ {
MetaRectangle w1rect, w2rect; MetaRectangle w1rect, w2rect;
meta_window_get_outer_rect (w1, &w1rect); meta_window_get_frame_rect (w1, &w1rect);
meta_window_get_outer_rect (w2, &w2rect); meta_window_get_frame_rect (w2, &w2rect);
return meta_rectangle_overlap (&w1rect, &w2rect); return meta_rectangle_overlap (&w1rect, &w2rect);
} }
@ -3733,11 +3733,11 @@ meta_window_maximize (MetaWindow *window,
MetaRectangle old_rect; MetaRectangle old_rect;
MetaRectangle new_rect; MetaRectangle new_rect;
meta_window_get_outer_rect (window, &old_rect); meta_window_get_frame_rect (window, &old_rect);
meta_window_move_resize_now (window); meta_window_move_resize_now (window);
meta_window_get_outer_rect (window, &new_rect); meta_window_get_frame_rect (window, &new_rect);
meta_compositor_maximize_window (window->display->compositor, meta_compositor_maximize_window (window->display->compositor,
window, window,
&old_rect, &old_rect,
@ -3796,7 +3796,7 @@ meta_window_get_all_monitors (MetaWindow *window, gsize *length)
int i; int i;
monitors = g_array_new (FALSE, FALSE, sizeof (int)); monitors = g_array_new (FALSE, FALSE, sizeof (int));
meta_window_get_outer_rect (window, &window_rect); meta_window_get_frame_rect (window, &window_rect);
for (i = 0; i < window->screen->n_monitor_infos; i++) for (i = 0; i < window->screen->n_monitor_infos; i++)
{ {
@ -3829,7 +3829,7 @@ meta_window_is_screen_sized (MetaWindow *window)
int screen_width, screen_height; int screen_width, screen_height;
meta_screen_get_size (window->screen, &screen_width, &screen_height); meta_screen_get_size (window->screen, &screen_width, &screen_height);
meta_window_get_outer_rect (window, &window_rect); meta_window_get_frame_rect (window, &window_rect);
if (window_rect.x == 0 && window_rect.y == 0 && if (window_rect.x == 0 && window_rect.y == 0 &&
window_rect.width == screen_width && window_rect.height == screen_height) window_rect.width == screen_width && window_rect.height == screen_height)
@ -3858,7 +3858,7 @@ meta_window_is_monitor_sized (MetaWindow *window)
{ {
MetaRectangle window_rect, monitor_rect; MetaRectangle window_rect, monitor_rect;
meta_window_get_outer_rect (window, &window_rect); meta_window_get_frame_rect (window, &window_rect);
meta_screen_get_monitor_geometry (window->screen, window->monitor->number, &monitor_rect); meta_screen_get_monitor_geometry (window->screen, window->monitor->number, &monitor_rect);
if (meta_rectangle_equal (&window_rect, &monitor_rect)) if (meta_rectangle_equal (&window_rect, &monitor_rect))
@ -3926,11 +3926,11 @@ meta_window_tile (MetaWindow *window)
MetaRectangle old_rect; MetaRectangle old_rect;
MetaRectangle new_rect; MetaRectangle new_rect;
meta_window_get_outer_rect (window, &old_rect); meta_window_get_frame_rect (window, &old_rect);
meta_window_move_resize_now (window); meta_window_move_resize_now (window);
meta_window_get_outer_rect (window, &new_rect); meta_window_get_frame_rect (window, &new_rect);
meta_compositor_maximize_window (window->display->compositor, meta_compositor_maximize_window (window->display->compositor,
window, window,
&old_rect, &old_rect,
@ -4098,7 +4098,7 @@ meta_window_unmaximize_internal (MetaWindow *window,
{ {
MetaRectangle old_rect, new_rect; MetaRectangle old_rect, new_rect;
meta_window_get_outer_rect (window, &old_rect); meta_window_get_frame_rect (window, &old_rect);
meta_window_move_resize_internal (window, meta_window_move_resize_internal (window,
META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION, META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION,
@ -4108,7 +4108,7 @@ meta_window_unmaximize_internal (MetaWindow *window,
target_rect.width, target_rect.width,
target_rect.height); target_rect.height);
meta_window_get_outer_rect (window, &new_rect); meta_window_get_frame_rect (window, &new_rect);
meta_compositor_unmaximize_window (window->display->compositor, meta_compositor_unmaximize_window (window->display->compositor,
window, window,
&old_rect, &old_rect,
@ -6129,16 +6129,17 @@ meta_window_frame_rect_to_client_rect (MetaWindow *window,
} }
/** /**
* meta_window_get_outer_rect: * meta_window_get_frame_rect:
* @window: a #MetaWindow * @window: a #MetaWindow
* @rect: (out): pointer to an allocated #MetaRectangle * @rect: (out): pointer to an allocated #MetaRectangle
* *
* Gets the rectangle that bounds @window that is responsive to mouse events. * Gets the rectangle that bounds @window that is what the user thinks of
* This includes only what is visible; it doesn't include any extra reactive * as the edge of the window. This doesn't include any extra reactive
* area we add to the edges of windows. * area that we or the client adds to the window, or any area that the
* client adds to draw a client-side shadow.
*/ */
void void
meta_window_get_outer_rect (const MetaWindow *window, meta_window_get_frame_rect (const MetaWindow *window,
MetaRectangle *rect) MetaRectangle *rect)
{ {
if (window->frame) if (window->frame)
@ -6167,6 +6168,25 @@ meta_window_get_outer_rect (const MetaWindow *window,
} }
} }
/**
* meta_window_get_outer_rect:
* @window: a #MetaWindow
* @rect: (out): pointer to an allocated #MetaRectangle
*
* Gets the rectangle that bounds @window that is what the user thinks of
* as the edge of the window. This doesn't include any extra reactive
* area that we or the client adds to the window, or any area that the
* client adds to draw a client-side shadow.
*
* Deprecated: 3.10: Use meta_window_get_frame_rect() instead.
*/
void
meta_window_get_outer_rect (const MetaWindow *window,
MetaRectangle *rect)
{
meta_window_get_frame_rect (window, rect);
}
const char* const char*
meta_window_get_startup_id (MetaWindow *window) meta_window_get_startup_id (MetaWindow *window)
{ {
@ -9241,7 +9261,7 @@ meta_window_show_menu (MetaWindow *window,
void void
meta_window_shove_titlebar_onscreen (MetaWindow *window) meta_window_shove_titlebar_onscreen (MetaWindow *window)
{ {
MetaRectangle outer_rect; MetaRectangle frame_rect;
GList *onscreen_region; GList *onscreen_region;
int horiz_amount, vert_amount; int horiz_amount, vert_amount;
int newx, newy; int newx, newy;
@ -9253,15 +9273,15 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
return; return;
/* Get the basic info we need */ /* Get the basic info we need */
meta_window_get_outer_rect (window, &outer_rect); meta_window_get_frame_rect (window, &frame_rect);
onscreen_region = window->screen->active_workspace->screen_region; onscreen_region = window->screen->active_workspace->screen_region;
/* Extend the region (just in case the window is too big to fit on the /* Extend the region (just in case the window is too big to fit on the
* screen), then shove the window on screen, then return the region to * screen), then shove the window on screen, then return the region to
* normal. * normal.
*/ */
horiz_amount = outer_rect.width; horiz_amount = frame_rect.width;
vert_amount = outer_rect.height; vert_amount = frame_rect.height;
meta_rectangle_expand_region (onscreen_region, meta_rectangle_expand_region (onscreen_region,
horiz_amount, horiz_amount,
horiz_amount, horiz_amount,
@ -9269,15 +9289,15 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
vert_amount); vert_amount);
meta_rectangle_shove_into_region(onscreen_region, meta_rectangle_shove_into_region(onscreen_region,
FIXED_DIRECTION_X, FIXED_DIRECTION_X,
&outer_rect); &frame_rect);
meta_rectangle_expand_region (onscreen_region, meta_rectangle_expand_region (onscreen_region,
-horiz_amount, -horiz_amount,
-horiz_amount, -horiz_amount,
0, 0,
-vert_amount); -vert_amount);
newx = outer_rect.x + window->frame->child_x; newx = frame_rect.x + window->frame->child_x;
newy = outer_rect.y + window->frame->child_y; newy = frame_rect.y + window->frame->child_y;
meta_window_move_resize (window, meta_window_move_resize (window,
FALSE, FALSE,
newx, newx,
@ -9302,7 +9322,7 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
return FALSE; return FALSE;
/* Get the rectangle corresponding to the titlebar */ /* Get the rectangle corresponding to the titlebar */
meta_window_get_outer_rect (window, &titlebar_rect); meta_window_get_frame_rect (window, &titlebar_rect);
titlebar_rect.height = window->frame->child_y; titlebar_rect.height = window->frame->child_y;
/* Run through the spanning rectangles for the screen and see if one of /* Run through the spanning rectangles for the screen and see if one of
@ -10532,7 +10552,7 @@ warp_grab_pointer (MetaWindow *window,
/* We may not have done begin_grab_op yet, i.e. may not be in a grab /* We may not have done begin_grab_op yet, i.e. may not be in a grab
*/ */
meta_window_get_outer_rect (window, &rect); meta_window_get_frame_rect (window, &rect);
switch (grab_op) switch (grab_op)
{ {
@ -10871,7 +10891,7 @@ meta_window_set_demands_attention (MetaWindow *window)
} }
else else
{ {
meta_window_get_outer_rect (window, &candidate_rect); meta_window_get_frame_rect (window, &candidate_rect);
/* The stack is sorted with the top windows first. */ /* The stack is sorted with the top windows first. */
@ -10882,7 +10902,7 @@ meta_window_set_demands_attention (MetaWindow *window)
if (meta_window_located_on_workspace (other_window, window->workspace)) if (meta_window_located_on_workspace (other_window, window->workspace))
{ {
meta_window_get_outer_rect (other_window, &other_rect); meta_window_get_frame_rect (other_window, &other_rect);
if (meta_rectangle_overlap (&candidate_rect, &other_rect)) if (meta_rectangle_overlap (&candidate_rect, &other_rect))
{ {
@ -11588,8 +11608,8 @@ meta_window_compute_tile_match (MetaWindow *window)
bottommost = match; bottommost = match;
} }
meta_window_get_outer_rect (bottommost, &bottommost_rect); meta_window_get_frame_rect (bottommost, &bottommost_rect);
meta_window_get_outer_rect (topmost, &topmost_rect); meta_window_get_frame_rect (topmost, &topmost_rect);
/* /*
* If there's a window stacked in between which is partially visible * If there's a window stacked in between which is partially visible
* behind the topmost tile we don't consider the tiles to match. * behind the topmost tile we don't consider the tiles to match.
@ -11603,7 +11623,7 @@ meta_window_compute_tile_match (MetaWindow *window)
meta_window_get_workspace (above) != meta_window_get_workspace (window)) meta_window_get_workspace (above) != meta_window_get_workspace (window))
continue; continue;
meta_window_get_outer_rect (above, &above_rect); meta_window_get_frame_rect (above, &above_rect);
if (meta_rectangle_overlap (&above_rect, &bottommost_rect) && if (meta_rectangle_overlap (&above_rect, &bottommost_rect) &&
meta_rectangle_overlap (&above_rect, &topmost_rect)) meta_rectangle_overlap (&above_rect, &topmost_rect))

View File

@ -110,7 +110,9 @@ gboolean meta_window_is_override_redirect (MetaWindow *window);
gboolean meta_window_is_skip_taskbar (MetaWindow *window); gboolean meta_window_is_skip_taskbar (MetaWindow *window);
MetaRectangle *meta_window_get_rect (MetaWindow *window); MetaRectangle *meta_window_get_rect (MetaWindow *window);
void meta_window_get_input_rect (const MetaWindow *window, MetaRectangle *rect); void meta_window_get_input_rect (const MetaWindow *window, MetaRectangle *rect);
void meta_window_get_outer_rect (const MetaWindow *window, MetaRectangle *rect);
void meta_window_get_frame_rect (const MetaWindow *window, MetaRectangle *rect);
void meta_window_get_outer_rect (const MetaWindow *window, MetaRectangle *rect) G_GNUC_DEPRECATED;
void meta_window_client_rect_to_frame_rect (MetaWindow *window, void meta_window_client_rect_to_frame_rect (MetaWindow *window,
MetaRectangle *frame_rect, MetaRectangle *frame_rect,