Closed Bug 317261 Opened 20 years ago Closed 19 years ago

[spatial navigation] prefs not read on startup

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Mook, Assigned: Mook)

References

()

Details

Attachments

(1 file, 1 obsolete file)

The Spatial Navigation service registers a pref observer to listen for pref changes, but does not actually read the prefs initially. If the prefs are set and saved, they will be ignored. Noticed this while trying to use "snav.keyCode.modifier". (Workaround for apps actually using snav: read the pref, set it as something other than the correct value, then set it back. This triggers two pref change notifications.) Please excuse me if I've filed the bug in the wrong place, wasn't where spatial navigation bugs should go.
this is the right place. mook, do you have a patch?
Err.... I didn't at the time :) This reads things in via observing profile-after-change; not sure if this is good (I'm not sure if that gets called on minimo, for example). Diffed against trunk. Very lightly tested on Firefox. Feel free to decimate :)
Attachment #203886 - Flags: review?(dougt)
Comment on attachment 203886 [details] [diff] [review] read prefs at profile-after-change does profile-after-change always get called, even in the embedding case. I remember a time when it wasn't.
Well, http://lxr.mozilla.org/mozilla/source/embedding/tests/mfcembed/MfcEmbed.cpp#684 says MFCEmbed gets it (and outside the USE_PROFILES #define too). But you're probably much more familiar than the code than I am - I'm just trying to use stuff in XULRunner :)
Comment on attachment 203886 [details] [diff] [review] read prefs at profile-after-change it seams like there should be an easier way -- like call into the prefs service and ask it to broadcast you all of the elements under the snav. branch via your existing nsIObserver. burt for now, this works.
Attachment #203886 - Flags: review?(dougt) → review+
The closest I could think of would be asking via nsIPrefBranch::getChildList to get a list of prefs, then calling notifyObservers manually... (I'm not familiar with this area of the code; do I need to request sr, or anything else, to get the patch commited to trunk? If not, would you be able to do it, seeing as I have no CVS account? Thanks)
there isn't. most people forge messages to their observer.
Comment on attachment 262752 [details] [diff] [review] user nsIObserverService.h instead of nsObserverService.h carrying over dougt's r+, and committing for mook. (I think bsmedberg broke nsObserverService.h - but it doesn't matter, we just need the interface - hence the change from ns to nsI)
Attachment #262752 - Flags: review+
Assignee: dougt → mook.moz+mozbz
Thanks for the checkin, timeless. Tested in a trunk build (I haven't touched this since 2006, I think :p ).
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: