From e31f55e1466774c14a4d75a7cf3e854a4ec7975c Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sat, 14 Apr 2012 14:30:45 +0200 Subject: [PATCH] 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 81bfe867a..78c900b04 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 31c7a2417..b710dd566 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 33e1b6357..5dac43ed5 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