[mutter] Make meta_workspace_get_neighbor() public



commit e31f55e1466774c14a4d75a7cf3e854a4ec7975c
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Apr 14 14:30:45 2012 +0200

    Make meta_workspace_get_neighbor() public
    
    There is no need for this function to be private, and it can
    greatly simplify gnome-shell code handling workspace switch.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674104

 src/core/workspace-private.h |    3 ---
 src/core/workspace.c         |   12 ++++++++++++
 src/meta/workspace.h         |    3 +++
 3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/core/workspace-private.h b/src/core/workspace-private.h
index 81bfe86..78c900b 100644
--- a/src/core/workspace-private.h
+++ b/src/core/workspace-private.h
@@ -98,9 +98,6 @@ void meta_workspace_focus_default_window (MetaWorkspace *workspace,
                                           MetaWindow    *not_this_one,
                                           guint32        timestamp);
 
-MetaWorkspace* meta_workspace_get_neighbor (MetaWorkspace      *workspace,
-                                            MetaMotionDirection direction);
-
 const char* meta_workspace_get_name (MetaWorkspace *workspace);
 
 #endif
diff --git a/src/core/workspace.c b/src/core/workspace.c
index 31c7a24..b710dd5 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -1117,6 +1117,18 @@ meta_motion_direction_to_string (MetaMotionDirection direction)
 }
 #endif /* WITH_VERBOSE_MODE */
 
+/**
+ * meta_workspace_get_neighbor:
+ * @workspace: a #MetaWorkspace
+ * @direction: a #MetaMotionDirection, relative to @workspace
+ *
+ * Calculate and retrive the workspace that is next to @workspace,
+ * according to @direction and the current workspace layout, as set
+ * by meta_screen_override_workspace_layout().
+ *
+ * Returns: (transfer none): the workspace next to @workspace, or
+ *   @workspace itself if the neighbor would be outside the layout
+ */
 MetaWorkspace*
 meta_workspace_get_neighbor (MetaWorkspace      *workspace,
                              MetaMotionDirection direction)
diff --git a/src/meta/workspace.h b/src/meta/workspace.h
index 33e1b63..5dac43e 100644
--- a/src/meta/workspace.h
+++ b/src/meta/workspace.h
@@ -63,4 +63,7 @@ void meta_workspace_update_window_hints (MetaWorkspace *workspace);
 void meta_workspace_set_builtin_struts (MetaWorkspace *workspace,
                                         GSList        *struts);
 
+MetaWorkspace* meta_workspace_get_neighbor (MetaWorkspace      *workspace,
+                                            MetaMotionDirection direction);
+
 #endif



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