From 28cda90034ca5dd9f58bd44999ea9b67a14040eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sergio=20Villar=20Sen=C3=ADn?= Date: Wed, 6 May 2009 14:21:53 +0200 Subject: [PATCH] Fixes the get_modal method of Hildon2 window manager --- src/hildon2/modest-hildon2-window-mgr.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hildon2/modest-hildon2-window-mgr.c b/src/hildon2/modest-hildon2-window-mgr.c index 4cef7e6..0f29579 100644 --- a/src/hildon2/modest-hildon2-window-mgr.c +++ b/src/hildon2/modest-hildon2-window-mgr.c @@ -813,22 +813,23 @@ modest_hildon2_window_mgr_get_modal (ModestWindowMgr *self) { ModestHildon2WindowMgrPrivate *priv; GList *toplevel_list; - GtkWidget *toplevel; - + GtkWindow *toplevel; + g_return_val_if_fail (MODEST_IS_HILDON2_WINDOW_MGR (self), NULL); priv = MODEST_HILDON2_WINDOW_MGR_GET_PRIVATE (self); toplevel = NULL; toplevel_list = gtk_window_list_toplevels (); while (toplevel_list) { - if (gtk_window_is_active (toplevel_list->data)) { - toplevel = toplevel_list->data; + if (gtk_window_is_active (toplevel_list->data) && + gtk_window_get_modal (toplevel_list->data)) { + toplevel = (GtkWindow *) toplevel_list->data; break; } toplevel_list = g_list_next (toplevel_list); } - return NULL; + return toplevel; } -- 1.7.9.5