Closed Bug 817385 Opened 12 years ago Closed 12 years ago

[toolbox] select tool when used from commands and inspect context menu

Categories

(DevTools :: General, defect, P1)

x86_64
Windows 7
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: Optimizer, Unassigned)

References

Details

or otherwise, everywhere where this function is used, should not assume that this function will also select the tool.
For example in 

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/nsContextMenu.js#420

STR :
1. Right click on page ans select inspect element.
2. Toolbox appears with the Inspect tool selected.
3. Switch to Style Editor tool
4. Rigth click on the page again and select inspect.
5. The highlighter appears, but inspect tool is not selected.
API-wise, `getPanelForTarget` is not supposed to handle any UI operation.

So I think we should just select the inspector in nsContextMenu.
Summary: [toolbox] getPanelForTarget should also focus the asked tool. → [toolbox] select the inspector on node->right click->inspector
Okay, and I think more places also, let me find out.
(In reply to Girish Sharma [:Optimizer] from comment #3)
> So I found a few more places too :
> 
> http://mxr.mozilla.org/mozilla-central/source/browser/devtools/tilt/
> TiltVisualizer.jsm#178

No need to call select here.

> http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/webconsole/
> WebConsoleUtils.jsm#1575

No need to call select here.

> http://mxr.mozilla.org/mozilla-central/source/browser/devtools/commandline/
> CmdBreak.jsm multiple places

I don't know about this one.

> http://mxr.mozilla.org/mozilla-central/source/browser/devtools/commandline/
> CmdDbg.jsm multiple places

I don't know about this one.

> http://mxr.mozilla.org/mozilla-central/source/browser/devtools/inspector/
> CmdInspect.jsm#37

Needed here.

We should not change the role of getPanel, but just add a call to select.
yes, I agree that getPanelForTarget should not select, as sometimes it might be needed to just refer and not select.

as for cmd Break and dbg, it is needed to focus the debugger onl yin case of dbg command, and I guess break command only adds a breakpoint, and does not opens the debugger.
Summary: [toolbox] select the inspector on node->right click->inspector → [toolbox] select tool when used from commands and inspect context menu
Blocks: 818451
No longer blocks: 818451
Priority: -- → P1
I can no longer reproduce this. I think this was fixed by bug 813031
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.