window: Rename get_input_rect to get_buffer_rect

With get_input_region existing, get_input_rect is a misnomer. Really,
it's about the geometry of the output surface, and it's only used that
way in the compositor code.

Way back when in GNOME 3.2, get_input_rect was added when we added
invisible borders. get_outer_rect was always synonymous with server-side
geometry of the toplevel. get_outer_rect was used for both user-side
policy (the "frame rect") and to get the geometry of the window.

Invisible borders were meant to extend the input region of the frame
window silently. Since most users of get_outer_rect cared about the
frame rect, we kept that the same and added a new method, get_input_rect
to get the full rect of the framed window with all invisible borders for
input kept on.

As time went on and CSD and Wayland became a reality, the relationship
between the server-side geometry and the "frame rect" became more
complicated, as can be evidenced by the recent commits. Since clients
don't tend to be framed anymore, they set their own input region.

get_buffer_rect is also sort of a poor name, since X11 doesn't really
have buffers, but we don't really have many other alternatives.

This doesn't change any of the code, nor the meaning. It will always
refer to the rectangle where the toplevel should be placed.
This commit is contained in:
Jasper St. Pierre 2014-06-17 10:33:52 -04:00
parent 9d5273bb15
commit 188e4e1b92
4 changed files with 13 additions and 10 deletions

View File

@ -555,7 +555,7 @@ meta_window_is_monitor_sized
meta_window_is_override_redirect
meta_window_is_skip_taskbar
meta_window_get_rect
meta_window_get_input_rect
meta_window_get_buffer_rect
meta_window_get_frame_rect
meta_window_get_outer_rect
meta_window_client_rect_to_frame_rect

View File

@ -1152,7 +1152,7 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
MetaWindowActorPrivate *priv = self->priv;
MetaRectangle window_rect;
meta_window_get_input_rect (priv->window, &window_rect);
meta_window_get_buffer_rect (priv->window, &window_rect);
/* When running as a Wayland compositor we catch size changes when new
* buffers are attached */

View File

@ -4036,17 +4036,20 @@ meta_window_get_session_geometry (MetaWindow *window,
}
/**
* meta_window_get_input_rect:
* meta_window_get_buffer_rect:
* @window: a #MetaWindow
* @rect: (out): pointer to an allocated #MetaRectangle
*
* Gets the rectangle that bounds @window that is responsive to mouse events.
* This includes decorations - the visible portion of its border - and (if
* present) any invisible area that we make make responsive to mouse clicks in
* order to allow convenient border dragging.
* Gets the rectangle that the pixmap or buffer of @window occupies.
*
* For X11 windows, this is the server-side geometry of the toplevel
* window.
*
* For Wayland windows, this is the bounding rectangle of the attached
* buffer.
*/
void
meta_window_get_input_rect (const MetaWindow *window,
meta_window_get_buffer_rect (const MetaWindow *window,
MetaRectangle *rect)
{
if (window->frame)

View File

@ -108,7 +108,7 @@ gboolean meta_window_appears_focused (MetaWindow *window);
gboolean meta_window_is_shaded (MetaWindow *window);
gboolean meta_window_is_override_redirect (MetaWindow *window);
gboolean meta_window_is_skip_taskbar (MetaWindow *window);
void meta_window_get_input_rect (const MetaWindow *window, MetaRectangle *rect);
void meta_window_get_buffer_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;