[metacity] window: add meta_window_get_workspace



commit bafd97747d4ddc94d416def132e3b5418fd8ba3f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Feb 27 20:11:22 2017 +0200

    window: add meta_window_get_workspace

 src/core/window-private.h |    2 ++
 src/core/window.c         |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 2df9613..9567487 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -591,6 +591,8 @@ void meta_window_set_gravity (MetaWindow *window,
 void meta_window_handle_mouse_grab_op_event (MetaWindow *window,
                                              XEvent     *event);
 
+MetaWorkspace *meta_window_get_workspace (MetaWindow *window);
+
 GList* meta_window_get_workspaces (MetaWindow *window);
 
 gboolean meta_window_located_on_workspace (MetaWindow    *window,
diff --git a/src/core/window.c b/src/core/window.c
index 96f84e0..ec71bf0 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -6120,6 +6120,15 @@ idle_update_icon (gpointer data)
   return FALSE;
 }
 
+MetaWorkspace *
+meta_window_get_workspace (MetaWindow *window)
+{
+  if (window->on_all_workspaces)
+    return window->screen->active_workspace;
+  else
+    return window->workspace;
+}
+
 GList*
 meta_window_get_workspaces (MetaWindow *window)
 {


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