[mutter] window: Rename get_input_rect to get_buffer_rect



commit 188e4e1b92ebee4eb95f4c522f42999e996e4cd6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jun 17 10:33:52 2014 -0400

    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.

 doc/reference/meta-sections.txt    |    2 +-
 src/compositor/meta-window-actor.c |    2 +-
 src/core/window.c                  |   17 ++++++++++-------
 src/meta/window.h                  |    2 +-
 4 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/doc/reference/meta-sections.txt b/doc/reference/meta-sections.txt
index 22d4350..5952f0a 100644
--- a/doc/reference/meta-sections.txt
+++ b/doc/reference/meta-sections.txt
@@ -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
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index f912844..6da79b7 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -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 */
diff --git a/src/core/window.c b/src/core/window.c
index 7b3d6c8..e1598b6 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4036,18 +4036,21 @@ 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,
-                            MetaRectangle    *rect)
+meta_window_get_buffer_rect (const MetaWindow *window,
+                             MetaRectangle    *rect)
 {
   if (window->frame)
     *rect = window->frame->rect;
diff --git a/src/meta/window.h b/src/meta/window.h
index 78ae8d1..6ef85df 100644
--- a/src/meta/window.h
+++ b/src/meta/window.h
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]