[evince] [shell] Optimize ev_application_has_window()
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] [shell] Optimize ev_application_has_window()
- Date: Mon, 12 Jul 2010 18:46:41 +0000 (UTC)
commit df0507d95502ee017b49ae3e19f75cfe64f2b04b
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Mon Jul 12 20:12:30 2010 +0200
[shell] Optimize ev_application_has_window()
shell/ev-application.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/shell/ev-application.c b/shell/ev-application.c
index ed4fb19..45dd9cd 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -1036,10 +1036,17 @@ ev_application_get_dbus_connection (EvApplication *application)
gboolean
ev_application_has_window (EvApplication *application)
{
- GList *windows = ev_application_get_windows (application);
- gboolean retval = windows != NULL;
+ GList *l, *toplevels;
+ gboolean retval = FALSE;
- g_list_free (windows);
+ toplevels = gtk_window_list_toplevels ();
+
+ for (l = toplevels; l != NULL && !retval; l = l->next) {
+ if (EV_IS_WINDOW (l->data))
+ retval = TRUE;
+ }
+
+ g_list_free (toplevels);
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]