+static GList *
+ev_application_get_windows (EvApplication *application)
+{
+ GList *l, *toplevels;
+ GList *windows = NULL;
+
+ toplevels = gtk_window_list_toplevels ();
+
+ for (l = toplevels; l != NULL; l = l->next) {
+ if (EV_IS_WINDOW (l->data)) {
+ windows = g_list_append (windows, l->data);
+ }
+ }
+
+ g_list_free (toplevels);
+
+ return windows;
+}
+
+static EvWindow *
+ev_application_get_empty_window (EvApplication *application,
+ GdkScreen *screen)
+{
+ EvWindow *empty_window = NULL;
+ GList *windows = ev_application_get_windows (application);
+ GList *l;
+
+ for (l = windows; l != NULL; l = l->next) {
+ EvWindow *window = EV_WINDOW (l->data);
+
+ if (ev_window_is_empty (window) &&
+ gtk_window_get_screen (GTK_WINDOW (window)) == screen) {
+ empty_window = window;
+ break;
+ }
+ }
+
+ g_list_free (windows);
+
+ return empty_window;
+}
+
+