diff --git a/src/core/window.c b/src/core/window.c index b5a945f8b..74f8e9539 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -8687,6 +8687,21 @@ meta_window_get_description (MetaWindow *window) return window->desc; } +/** + * 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 b09091df5..83d95b484 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);