diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c index 194b0cfc87..7aff3a9f81 100644 --- a/gdk/broadway/gdkdisplay-broadway.c +++ b/gdk/broadway/gdkdisplay-broadway.c @@ -316,6 +316,14 @@ gdk_broadway_display_get_setting (GdkDisplay *display, return FALSE; } +static GdkWindow * +gdk_broadway_display_get_root_window (GdkDisplay *display) +{ + GdkBroadwayDisplay *broadway_display = GDK_BROADWAY_DISPLAY (display); + + return gdk_broadway_screen_get_root_window (broadway_display->default_screen); +} + static void gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class) { @@ -365,5 +373,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class) display_class->get_monitor = gdk_broadway_display_get_monitor; display_class->get_primary_monitor = gdk_broadway_display_get_primary_monitor; display_class->get_setting = gdk_broadway_display_get_setting; + display_class->get_root_window = gdk_broadway_display_get_root_window; } diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index 8ac18262a4..3af5dc5025 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -2249,3 +2249,25 @@ gdk_display_setting_changed (GdkDisplay *display, { g_signal_emit (display, signals[SETTING_CHANGED], 0, name); } + +GList * +gdk_display_get_toplevel_windows (GdkDisplay *display) +{ + GdkWindow * root_window; + GList *new_list = NULL; + GList *tmp_list; + + root_window = GDK_DISPLAY_GET_CLASS (display)->get_root_window (display); + + tmp_list = root_window->children; + while (tmp_list) + { + GdkWindow *w = tmp_list->data; + + if (w->window_type != GDK_WINDOW_FOREIGN) + new_list = g_list_prepend (new_list, w); + tmp_list = tmp_list->next; + } + + return new_list; +} diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h index c0b9aa5b37..463a6199ce 100644 --- a/gdk/gdkdisplayprivate.h +++ b/gdk/gdkdisplayprivate.h @@ -224,6 +224,7 @@ struct _GdkDisplayClass gboolean (*get_setting) (GdkDisplay *display, const char *name, GValue *value); + GdkWindow * (*get_root_window) (GdkDisplay *display); /* Signals */ void (*opened) (GdkDisplay *display); @@ -307,6 +308,8 @@ void gdk_display_emit_opened (GdkDisplay *display void gdk_display_setting_changed (GdkDisplay *display, const char *name); +GList * gdk_display_get_toplevel_windows (GdkDisplay *display); + G_END_DECLS #endif /* __GDK_DISPLAY_PRIVATE_H__ */ diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c index 3376cbb27c..944212bf8c 100644 --- a/gdk/quartz/gdkdisplay-quartz.c +++ b/gdk/quartz/gdkdisplay-quartz.c @@ -248,6 +248,12 @@ gdk_quartz_display_finalize (GObject *object) G_OBJECT_CLASS (gdk_quartz_display_parent_class)->finalize (object); } +static GdkWindow * +gdk_quartz_display_get_root_window (GdkDisplay *display) +{ + return _gdk_root; +} +` static void gdk_quartz_display_class_init (GdkQuartzDisplayClass *class) { @@ -297,6 +303,7 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class) display_class->get_monitor = gdk_quartz_display_get_monitor; display_class->get_primary_monitor = gdk_quartz_display_get_primary_monitor; display_class->get_setting = gdk_quartz_display_get_setting; + display_class->get_root_window = gdk_quartz_display_get_root_window; ProcessSerialNumber psn = { 0, kCurrentProcess }; diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 98cf1c2a0d..5c6fcdc19b 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -989,6 +989,12 @@ gdk_wayland_display_get_setting (GdkDisplay *display, return gdk_wayland_screen_get_setting (GDK_WAYLAND_DISPLAY (display)->screen, name, value); } +static GdkWindow * +gdk_wayland_display_get_root_window (GdkDisplay *display) +{ + return gdk_wayland_screen_get_root_window (GDK_WAYLAND_DISPLAY (display)->screen); +} + static void gdk_wayland_display_class_init (GdkWaylandDisplayClass *class) { @@ -1048,6 +1054,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class) display_class->get_monitor = gdk_wayland_display_get_monitor; display_class->get_monitor_at_window = gdk_wayland_display_get_monitor_at_window; display_class->get_setting = gdk_wayland_display_get_setting; + display_class->get_root_window = gdk_wayland_display_get_root_window; } static void diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h index 6bf992584c..1a45bad0ec 100644 --- a/gdk/wayland/gdkprivate-wayland.h +++ b/gdk/wayland/gdkprivate-wayland.h @@ -213,6 +213,7 @@ GdkWindow *_gdk_wayland_screen_create_root_window (GdkScreen *screen, gboolean gdk_wayland_screen_get_setting (GdkScreen *screen, const gchar *name, GValue *value); +GdkWindow *gdk_wayland_screen_get_root_window (GdkScreen *screen); GdkScreen *_gdk_wayland_screen_new (GdkDisplay *display); void _gdk_wayland_screen_add_output (GdkScreen *screen, diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c index 3c468522a2..0778225ecf 100644 --- a/gdk/wayland/gdkscreen-wayland.c +++ b/gdk/wayland/gdkscreen-wayland.c @@ -105,7 +105,7 @@ gdk_wayland_screen_get_display (GdkScreen *screen) return GDK_WAYLAND_SCREEN (screen)->display; } -static GdkWindow * +GdkWindow * gdk_wayland_screen_get_root_window (GdkScreen *screen) { return GDK_WAYLAND_SCREEN (screen)->root_window; diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index 71ffe7166c..ac196070fb 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -1238,6 +1238,12 @@ gdk_win32_display_get_setting (GdkDisplay *display, value); } +static GdkWindow * +gdk_win32_display_get_root_window (GdkDisplay *display) +{ + return gdk_win32_screen_get_root_window (GDK_WIN32_DISPLAY (display)->screen); +} + static void gdk_win32_display_class_init (GdkWin32DisplayClass *klass) { @@ -1300,6 +1306,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass) #endif display_class->get_setting = gdk_win32_display_get_setting; + display_class->get_root_window = gdk_win32_display_get_root_window; _gdk_win32_windowing_init (); } diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index ef51184be1..ae44ba4f40 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -504,6 +504,7 @@ void _gdk_win32_window_delete_property (GdkWindow *window, GdkAtom property); /* Stray GdkWin32Screen members */ gboolean _gdk_win32_screen_get_setting (GdkScreen *screen, const gchar *name, GValue *value); void _gdk_win32_screen_on_displaychange_event (GdkWin32Screen *screen); +GdkWindow *gdk_win32_screen_get_root_window (GdkScreen *screen); /* Distributed display manager implementation */ GdkDisplay *_gdk_win32_display_open (const gchar *display_name); diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c index addfe01c59..a174b9eed8 100644 --- a/gdk/win32/gdkscreen-win32.c +++ b/gdk/win32/gdkscreen-win32.c @@ -183,7 +183,7 @@ gdk_win32_screen_get_display (GdkScreen *screen) return _gdk_display; } -static GdkWindow * +GdkWindow * gdk_win32_screen_get_root_window (GdkScreen *screen) { return GDK_WIN32_SCREEN (screen)->root_window; diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 2c3cf7fd50..768d91dd24 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -3135,6 +3135,12 @@ gdk_x11_display_get_setting (GdkDisplay *display, return gdk_x11_screen_get_setting (GDK_X11_DISPLAY (display)->screen, name, value); } +static GdkWindow * +gdk_x11_display_get_root_window (GdkDisplay *display) +{ + return gdk_x11_screen_get_root_window (GDK_X11_DISPLAY (display)->screen); +} + static void gdk_x11_display_class_init (GdkX11DisplayClass * class) { @@ -3196,6 +3202,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) display_class->get_monitor = gdk_x11_display_get_monitor; display_class->get_primary_monitor = gdk_x11_display_get_primary_monitor; display_class->get_setting = gdk_x11_display_get_setting; + display_class->get_root_window = gdk_x11_display_get_root_window; _gdk_x11_windowing_init (); } diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 7633e23b42..9ae1408552 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -79,7 +79,7 @@ gdk_x11_screen_get_display (GdkScreen *screen) return GDK_X11_SCREEN (screen)->display; } -static GdkWindow * +GdkWindow * gdk_x11_screen_get_root_window (GdkScreen *screen) { return GDK_X11_SCREEN (screen)->root_window; diff --git a/gdk/x11/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h index 81c1781e87..e40670afe6 100644 --- a/gdk/x11/gdkscreen-x11.h +++ b/gdk/x11/gdkscreen-x11.h @@ -117,6 +117,7 @@ void gdk_x11_screen_get_work_area (GdkScreen *screen, gboolean gdk_x11_screen_get_setting (GdkScreen *screen, const char *name, GValue *value); +GdkWindow *gdk_x11_screen_get_root_window (GdkScreen *screen); G_END_DECLS