From c085fba4988bbc503602e1f3c9c12a5808c8f555 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Dapena=20Paz?= Date: Thu, 11 Feb 2010 10:35:08 +0100 Subject: [PATCH] Set better modal windows in hildon2 window manager to avoid keyboard focus hangs. Fixes NB#149836. --- src/hildon2/modest-hildon2-window-mgr.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/hildon2/modest-hildon2-window-mgr.c b/src/hildon2/modest-hildon2-window-mgr.c index ae9c239..a5c957a 100644 --- a/src/hildon2/modest-hildon2-window-mgr.c +++ b/src/hildon2/modest-hildon2-window-mgr.c @@ -878,6 +878,20 @@ modest_hildon2_window_mgr_set_modal (ModestWindowMgr *self, gtk_window_set_modal (window, TRUE); gtk_window_set_transient_for (window, parent); gtk_window_set_destroy_with_parent (window, TRUE); + + if (!gtk_window_has_toplevel_focus (window)) { + GList *toplevels, *node; + + toplevels = gtk_window_list_toplevels (); + for (node = toplevels; node != NULL; node = g_list_next (node)) { + if (gtk_window_has_toplevel_focus (GTK_WINDOW (node->data))) { + if (GTK_IS_DIALOG (node->data)) { + gtk_window_set_transient_for (window, GTK_WINDOW (node->data)); + } + break; + } + } + } } static void -- 1.7.9.5