window: Make meta_window_located_on_workspace() public

We have some code in gnome-shell that does the equivalent of:

    window.get_workspace() == workspace || window.is_on_all_workspaces();

which is a bit unwieldy. We already have a method in mutter,
so use that and document it.

https://bugzilla.gnome.org/show_bug.cgi?id=691744
This commit is contained in:
Jasper St. Pierre 2013-01-14 12:34:14 -05:00
parent e28a36affd
commit d8eb47e2b7
3 changed files with 10 additions and 3 deletions

View File

@ -595,9 +595,6 @@ void meta_window_handle_mouse_grab_op_event (MetaWindow *window,
GList* meta_window_get_workspaces (MetaWindow *window); GList* meta_window_get_workspaces (MetaWindow *window);
gboolean meta_window_located_on_workspace (MetaWindow *window,
MetaWorkspace *workspace);
void meta_window_get_work_area_current_monitor (MetaWindow *window, void meta_window_get_work_area_current_monitor (MetaWindow *window,
MetaRectangle *area); MetaRectangle *area);
void meta_window_get_work_area_for_monitor (MetaWindow *window, void meta_window_get_work_area_for_monitor (MetaWindow *window,

View File

@ -2109,6 +2109,14 @@ set_net_wm_state (MetaWindow *window)
} }
} }
/**
* meta_window_located_on_workspace:
* @window: a #MetaWindow
* @workspace: a #MetaWorkspace
*
* Returns whether @window is displayed on @workspace, or whether it
* will be displayed on all workspaces.
*/
gboolean gboolean
meta_window_located_on_workspace (MetaWindow *window, meta_window_located_on_workspace (MetaWindow *window,
MetaWorkspace *workspace) MetaWorkspace *workspace)

View File

@ -85,6 +85,8 @@ Atom meta_window_get_window_type_atom (MetaWindow *window);
MetaWorkspace *meta_window_get_workspace (MetaWindow *window); MetaWorkspace *meta_window_get_workspace (MetaWindow *window);
int meta_window_get_monitor (MetaWindow *window); int meta_window_get_monitor (MetaWindow *window);
gboolean meta_window_is_on_all_workspaces (MetaWindow *window); gboolean meta_window_is_on_all_workspaces (MetaWindow *window);
gboolean meta_window_located_on_workspace (MetaWindow *window,
MetaWorkspace *workspace);
gboolean meta_window_is_hidden (MetaWindow *window); gboolean meta_window_is_hidden (MetaWindow *window);
void meta_window_activate (MetaWindow *window,guint32 current_time); void meta_window_activate (MetaWindow *window,guint32 current_time);
void meta_window_activate_with_workspace (MetaWindow *window, void meta_window_activate_with_workspace (MetaWindow *window,