From: Sergio Villar SenĂ­n Date: Wed, 6 May 2009 12:21:53 +0000 (+0200) Subject: Fixes the get_modal method of Hildon2 window manager X-Git-Tag: 3.0.17-rc3~10 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=28cda90034ca5dd9f58bd44999ea9b67a14040eb Fixes the get_modal method of Hildon2 window manager --- 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; }