diff --git a/src/core/display.c b/src/core/display.c index c99edc8f0..60b8add77 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2389,6 +2389,31 @@ mru_cmp (gconstpointer a, return 0; } +/** + * meta_display_list_all_windows: + * @display: a #MetaDisplay + * + * List all windows, including override-redirect ones. The windows are + * in no particular order. + * + * Returns: (transfer container) (element-type Meta.Window): List of windows + */ +GList * +meta_display_list_all_windows (MetaDisplay *display) +{ + GList *all_windows = NULL; + g_autoptr (GSList) windows = NULL; + GSList *l; + + windows = meta_display_list_windows (display, + META_LIST_INCLUDE_OVERRIDE_REDIRECT); + + /* Yay for mixing GList and GSList in the API */ + for (l = windows; l; l = l->next) + all_windows = g_list_prepend (all_windows, l->data); + return all_windows; +} + /** * meta_display_get_tab_list: * @display: a #MetaDisplay diff --git a/src/meta/display.h b/src/meta/display.h index 23bcbd0f5..e59bd0393 100644 --- a/src/meta/display.h +++ b/src/meta/display.h @@ -110,6 +110,9 @@ guint32 meta_display_get_current_time (MetaDisplay *display); META_EXPORT guint32 meta_display_get_current_time_roundtrip (MetaDisplay *display); +META_EXPORT +GList * meta_display_list_all_windows (MetaDisplay *display); + META_EXPORT GList* meta_display_get_tab_list (MetaDisplay *display, MetaTabList type,