Closed Bug 818442 Opened 12 years ago Closed 11 years ago

[toolbox] Re-focus devtools window after locking the highlighter

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: miker, Assigned: paul)

Details

Attachments

(1 file, 4 obsolete files)

STR:
- Open the DevTools and undock into a separate window.
- Start the inspector
- Select and element on the current page.

Expected:
Devtools window is raised and focused so you can start debugging the selection.

Actual:
Browser window remains focused.

Original Github bug:
https://github.com/joewalker/devtools-window/issues/239
Do we really want to do that?

That would mean that every time we click on a node, we would lose the focus from the browser window and the devtools window would be raised, but you'll still have to move your mouse to reach the devtools window.

I you just want to inspect a node (get information from the inspector or from the infobar), this could be very very annoying.

If you want to edit the style or the markup, you'll will have to reach the window anyway.
I agree with paul.

Harth, this was your bug ... what do you think?
WONTFIX. If anyone disagree, please re-open.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
I still want this.

The problem is that the devtools window gets lost behind the other windows. If you're using the inspector, most likely you'll want to see the styles or navigate further with the breadcrumbs after you've selected a node (at least that's what it's like for me). Right now I have to spend a distracting several seconds finding that window after I've selected my node.

Also, try this:

1) Open tools
2) Select Inspector tool
3) Undock
4) Close the devtools window
5) Open tools

Expected:
Devtools window appears.

Actual:
Devtools window is opened, but inspector has focused the browser window so you don't see it, even after you've selected a node.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Priority: -- → P2
Attached patch v1 (obsolete) — Splinter Review
Hacked up a trivial patch to see how it feels. This feels OK to me.
Other browsers to the same.
Assignee: nobody → jwalker
Status: REOPENED → ASSIGNED
Attachment #699723 - Flags: feedback?(paul)
Attachment #699723 - Flags: feedback?(fayearthur)
(In reply to Joe Walker [:joe_walker] [:jwalker] from comment #5)
> Created attachment 699723 [details] [diff] [review]
> v1
> 
> Hacked up a trivial patch to see how it feels. This feels OK to me.
> Other browsers to the same.

We're working on the same patch at the same time :)
I'm working on a broader approach.
Attached patch v2 (obsolete) — Splinter Review
I introduce a new function: lockAndFocus. We still need to keep the lock function because it's useful in some situations. This addresses comment 0 and comment 4.
Assignee: jwalker → paul
Attachment #699723 - Attachment is obsolete: true
Attachment #699723 - Flags: feedback?(paul)
Attachment #699723 - Flags: feedback?(fayearthur)
Attachment #699757 - Flags: review?(fayearthur)
s/lock/unlock/g in comment 7
Whiteboard: [needs-review]
Comment on attachment 699757 [details] [diff] [review]
v2

Paul, this isn't working for me on OS X. It appears to focus the devtools window but then immediately re-focus the browser window.

Joe's works for me.
Attachment #699757 - Flags: review?(fayearthur) → review-
(In reply to Heather Arthur [:harth] from comment #9)
> Comment on attachment 699757 [details] [diff] [review]
> v2
> 
> Paul, this isn't working for me on OS X. It appears to focus the devtools
> window but then immediately re-focus the browser window.

STR in comment 0 or comment 4?

I think I know what's wrong...
Whiteboard: [needs-review]
(In reply to Paul Rouget [:paul] from comment #10)
> (In reply to Heather Arthur [:harth] from comment #9)
> > Comment on attachment 699757 [details] [diff] [review]
> > v2
> > 
> > Paul, this isn't working for me on OS X. It appears to focus the devtools
> > window but then immediately re-focus the browser window.
> 
> STR in comment 0 or comment 4?
> 
> I think I know what's wrong...

No, I don't. On Linux, it appears to work fine.

Do you use the STR from comment 0?
Flags: needinfo?(fayearthur)
(In reply to Paul Rouget [:paul] from comment #11)
> (In reply to Paul Rouget [:paul] from comment #10)
> > (In reply to Heather Arthur [:harth] from comment #9)
> > > Comment on attachment 699757 [details] [diff] [review]
> > > v2
> > > 
> > > Paul, this isn't working for me on OS X. It appears to focus the devtools
> > > window but then immediately re-focus the browser window.
> > 
> > STR in comment 0 or comment 4?
> > 
> > I think I know what's wrong...
> 
> No, I don't. On Linux, it appears to work fine.
> 
> Do you use the STR from comment 0?

Yep, using the STR.
Flags: needinfo?(fayearthur)
Comment on attachment 699757 [details] [diff] [review]
v2

Review of attachment 699757 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/devtools/inspector/Highlighter.jsm
@@ +295,5 @@
>      if (this.locked === false) return;
>      this.outline.removeAttribute("locked");
>      this.nodeInfo.container.removeAttribute("locked");
>      this.attachMouseListeners();
>      this.locked = false;

We shouldn't get rid of this. Without it, it's confusing to use the highlighter on Mac.
Comment on attachment 699757 [details] [diff] [review]
v2

Review of attachment 699757 [details] [diff] [review]:
-----------------------------------------------------------------

Whoops, last comment was supposed to be:

::: browser/devtools/inspector/Highlighter.jsm
@@ -296,5 @@
>      this.outline.removeAttribute("locked");
>      this.nodeInfo.container.removeAttribute("locked");
>      this.attachMouseListeners();
>      this.locked = false;
> -    this.chromeWin.focus();

We shouldn't get rid of this. Without it, it's confusing to use the highlighter on Mac.
Disregard previous two comments, I got confused. Anyways, I'm currently debugging this on Mac.
Attached patch modification for Mac (obsolete) — Splinter Review
This is Paul's patch, but I removed a `win.focus()` that was re-focusing the browser window right after focusing the devtools window on Mac.

I don't know the exact implications of removing that focus() call, but I found that it was added in bug 642471 and looks like it could be unnecessary now. Let me know if it works on Win/Linux.
Attached patch Modifications 2 (obsolete) — Splinter Review
This one adds one more modification: starting the highlighter will focus the browser window for easier selection, the original behavior regressed by the first patch.
Attachment #702145 - Attachment is obsolete: true
Attachment #702995 - Flags: feedback?(paul)
Blocks: DevToolsPaperCuts
No longer blocks: 816946
Comment on attachment 702995 [details] [diff] [review]
Modifications 2

Delete this line:
>  let win = aEvent.target.ownerDocument.defaultView
Attachment #702995 - Flags: feedback?(paul) → feedback+
Attached patch v3Splinter Review
Includes Heather's changes.
Attachment #699757 - Attachment is obsolete: true
Attachment #702995 - Attachment is obsolete: true
Attachment #703937 - Flags: review?(fayearthur)
Comment on attachment 703937 [details] [diff] [review]
v3

awesome, thanks.
Attachment #703937 - Flags: review?(fayearthur) → review+
Whiteboard: [land-in-fx-team]
https://hg.mozilla.org/integration/fx-team/rev/6905b4296e9f
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/6905b4296e9f
Status: ASSIGNED → RESOLVED
Closed: 12 years ago11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 21
No longer blocks: DevToolsPaperCuts
Is this intended to not work anymore, now that the highlighter doesn't get locked anymore?
This appears to be currently broken on Windows. Anyone know if the behavious was reverted elsewhere or if it's a regression?
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: