From fe30865782f46329fc985bcdf57ad009eb23c61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Tue, 31 Jul 2012 16:24:37 +0200 Subject: [PATCH] Bug 752988 - Focus lost when closing notification bars. r=enn --HG-- extra : rebase_source : acb2409d7ac7e0a61525b59e4e9958df2c787c57 --- toolkit/content/widgets/notification.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/toolkit/content/widgets/notification.xml b/toolkit/content/widgets/notification.xml index 17d7241cdf2e..2df6e6eedd5d 100644 --- a/toolkit/content/widgets/notification.xml +++ b/toolkit/content/widgets/notification.xml @@ -168,6 +168,12 @@ if (aChild.eventCallback) aChild.eventCallback("removed"); this.removeChild(aChild); + + // make sure focus doesn't get lost (workaround for bug 570835) + let fm = Components.classes["@mozilla.org/focus-manager;1"] + .getService(Components.interfaces.nsIFocusManager); + if (!fm.getFocusedElementForWindow(window, false, {})) + fm.moveFocus(window, this, fm.MOVEFOCUS_FORWARD, 0); ]]>