[mutter] Add meta_window_get_wm_class



commit 2ed1bf05d156b0e7c4b756bcfceef1b33e2a97f6
Author: Colin Walters <walters verbum org>
Date:   Fri May 29 13:26:18 2009 -0400

    Add meta_window_get_wm_class
    
    Public function to retrieve the cached WM_CLASS, used in gnome-shell
    for tracking applications.
---
 src/core/window.c    |   15 +++++++++++++++
 src/include/window.h |    1 +
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/core/window.c b/src/core/window.c
index b5a945f..74f8e95 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8688,6 +8688,21 @@ meta_window_get_description (MetaWindow *window)
 }
 
 /**
+ * meta_window_get_wm_class:
+ * @window: a #MetaWindow
+ * 
+ * Return the current value of the WM_CLASS X property.
+ */
+const char *
+meta_window_get_wm_class (MetaWindow *window)
+{
+  if (!window)
+    return NULL;
+
+  return window->res_class;
+}
+
+/**
  * meta_window_get_compositor_private:
  * @window: a #MetaWindow
  *
diff --git a/src/include/window.h b/src/include/window.h
index b09091d..83d95b4 100644
--- a/src/include/window.h
+++ b/src/include/window.h
@@ -85,6 +85,7 @@ void     meta_window_activate_with_workspace (MetaWindow    *window,
                                               guint32        current_time,
                                               MetaWorkspace *workspace);
 const char * meta_window_get_description (MetaWindow *window);
+const char * meta_window_get_wm_class (MetaWindow *window);
 /* Return whether the window would be showing if we were on its workspace */
 gboolean    meta_window_showing_on_its_workspace (MetaWindow *window);
 



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