[Pkg-mozext-commits] [firebug] 31/48: Issue 7465: Console tab steals window focus in detach mode

David Prévot taffit at moszumanska.debian.org
Tue Jun 3 01:47:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit 42c525ea4c89ac4db89bc9c18124318e374266c5
Author: Florent FAYOLLE <florent.fayolle69 at gmail.com>
Date:   Mon May 19 21:44:07 2014 +0200

    Issue 7465: Console tab steals window focus in detach mode
---
 extension/content/firebug/console/consolePanel.js | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/extension/content/firebug/console/consolePanel.js b/extension/content/firebug/console/consolePanel.js
index 6c9cc03..71e1dd9 100644
--- a/extension/content/firebug/console/consolePanel.js
+++ b/extension/content/firebug/console/consolePanel.js
@@ -211,9 +211,26 @@ ConsolePanel.prototype = Obj.extend(ActivablePanel,
 
         this.showCommandLine(true);
 
-        // Don't steal the focus if the document is not loaded (see issue 6589).
-        if (this.context.window.document.readyState === "complete")
+        // Is true when the user has switched to a different panel.
+        // Is false when they has switched to a different Firefox tab with the same Firebug panel.
+        // Note: is also true when the user opens Firebug for the first time on the webpage
+        // (previousPanelName is undefined in this case).
+        var hasSwitchedPanel = (this.context.panelName !== this.context.previousPanelName);
+
+        // Cover these three cases:
+        // - Opening Firebug should focus Command Line (issue 6620)
+        // - Switching to Console panel without Firebug being focused should focus the Command Line
+        //    (issue 6619)
+        // - The Command Line in detached mode should not steal the focus when switching tabs
+        //    (issue 7465)
+        //
+        // xxxFlorent: FIXME? Opening Firebug twice in detached mode on the same webpage doesn't
+        // give the Focus to the Command Line.
+        if (this.context.window.document.readyState === "complete" &&
+            !(Firebug.isDetached() && !hasSwitchedPanel))
+        {
             CommandLine.focus(this.context);
+        }
 
         this.showToolbarButtons("fbConsoleButtons", true);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list