Closed Bug 371484 Opened 19 years ago Closed 18 years ago

Opening prefs when Web Features is the last pane causes glitch in FKA tab chain

Categories

(Camino Graveyard :: Preferences, defect, P3)

PowerPC
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.6

People

(Reporter: alqahira, Assigned: mark)

References

Details

(Keywords: access, fixed1.8.1.12, polish)

Attachments

(1 file, 1 obsolete file)

So mento's bug was real :( and I can consistently reproduce it when I open prefs (a second time) after having left Web Features selected the last time. In that case, we jump from the pop-ups checkbox to the dom.disable box then to the pop-up exceptions button. If you switch panes and come back, the chain is fine. If some other pane is selected when you open prefs, you're fine. I'm not sure what happened, because the last nib we all looked at worked :( This is kind-of ugly and annoying for FKA folks, but I'm not sure whether it's worth breaking freeze/doing late-l10n for a fix....
Pulling some prefPane polish bugs to 1.6 as well, per roadmap discussions.
Priority: -- → P3
Target Milestone: --- → Camino1.6
This will be more noticeable after bug 383959 lands....
We lost a link in this pane along the way, which I just fixed, but unfortunately that didn't have any effect on this behavior :(
The preferences window never has an initial first responder set, which causes NSWindow to call recalculateKeyViewLoop all by itself when the window opens. The bug doesn't occur when you switch panes witht he window already open because that just loads a pane without any recalculateKeyViewLoop business. We can fix this by giving the preferences window an initial first responder. A good choice would be to use firstValidKeyView in the same place we call makeFirstResponder. But... I also don't like how we never hit makeFirstResponder when you close and then reopen the prefs window - the old first responder from before the window was closed is remembered. I think we should change that. And also... This is all kind of tied up with bug 278820, too. I think we're getting some stuff wrong with the way we've set up the tab view in the appearance pane. It'd be nice to get this stuff all figured out.
As discussed above, when an NSWindow opens and there is no initialFirstResponder, it calls recalculateKeyViewLoop to establish a key view loop without regard for any contained objects' nextKeyView settings. We always had good key view loops set up with nextKeyView, and we were always setting the first responder when we loaded a pane with makeFirstResponder, but we never had an initial first responder set, so when the preferences window reopened, AppKit would build its own key view loop for us. In the case of the Web Features pane, its geometrically-computed key view loop was different from the proper key view loop we had established. All we need to do is set the initial first responder to something - anything will do, since we put focus where we want it with makeFirstResponder. Here, I set it to a value that makes sense, so we can pick it up and call makeFirstResponder to move the key view to what's correct for the selected pane when the preferences window closes and then reopens. This does the right thing when the prefs window is minimized. It also does the right thing with FKA off or on.
Assignee: nobody → mark
Status: NEW → ASSIGNED
Attachment #294971 - Flags: review?(stuart.morgan)
Does this fix bug 370108, which sounds to me like the actual bug responsible for all this mess? I thought of it between reading comment 5 and coming back to see comment 6 ;) (And or bug 327203 comment 16)
No, and furthermore, with this patch, if you have FKA on with the prefs open in a pane that has something other than a text box as its initial first responder, close the prefs, turn FKA off, and reopen the prefs, the non-text box initial first responder will have focus, contrary to FKA being off.
This is a little bit more aggressive. It recalculates what the current first responder should be whenever a preference pane is loaded or when the window is reopened after having been closed, which gets us proper FKA behavior every time we change panes or open the preferences window. It fixes bug 370108 as far as I can see Safari and other AppKit users behaving on my system, meaning that FKA is respected at all times, but switching FKA off will not blur the currently focused control even if it's something that is unfocusable without FKA. I've changed the algorithm for determining the first valid key view to be slightly more reliable - it should be a little more flexible in that it'll do the right thing with more types of key view loops in preference panes.
Attachment #294971 - Attachment is obsolete: true
Attachment #294995 - Flags: review?(stuart.morgan)
Attachment #294971 - Flags: review?(stuart.morgan)
Blocks: 358318
Comment on attachment 294995 [details] [diff] [review] Set the initial first responder, and recalculate and set the current first responder when loading and reopening preference panes >+ // If the initial first responder can't behave as a valid key view, >+ // whatever follows it as a valid key view in the loop must be the first >+ // valid one. This can still be nil. >+ firstValidKeyView = nextValidKeyView; >+ } >+ >+ [mWindow makeFirstResponder:firstValidKeyView]; Since you just said that fVKV can be nil, shouldn't this be if (firstValidKeyView) [mWindow makeFirst... ?
Attachment #294995 - Flags: review?(stuart.morgan) → review+
No, if fVKV is nil, we want to clear the first responder.
Checked in on the trunk and MOZILLA_1_8_BRANCH for 1.6b1.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1.12
Resolution: --- → FIXED
Clearing the b3 flag.
Flags: camino1.6b3?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: