Open
Bug 582790
Opened 16 years ago
Updated 3 years ago
When embedding Mozilla on Windows, dialog keyboard navigation and keyboard shortcuts for the embedding application sporadically fail
Categories
(Core :: Widget: Win32, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: dmercredi, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
|
1.52 KB,
patch
|
roc
:
review-
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4
Build Identifier: XulRunner SDK 1.9.2.8pre snapshot 20100728135525
This is the root cause of bug 508901, which gives a good repro case.
I've tracked down the root problem.
When embedding Mozilla, nsBaseAppShell/nsAppShell periodically bypass the embedding application's main message loop and pumps windows messages while it's processing dispatched events.
Sequence of events:
1. nsBaseAppShell::NativeEventCallback() is called in response to a posted Windows message via nsAppShell::ScheduleNativeEventCallback()
2. mEventloopNestingState is eEventloopNone because nsAppShell doesn't control the top level message loop - that's done by the embedding application.
3. nsBaseAppShell::NativeEventCallback() calls NS_ProcessPendingEvents(), which (eventually) calls back to nsBaseAppShell::OnProcessNextEvent(), which pumps Windows messages.
The main symptom is that keyboard messages are sporadically handled incorrectly because IsDialogMessage(), PreTranslateMessage(), TranslateMessage(), etc. on the application's message loop aren't called when NativeEventCallback() is active. Tabbing between controls suddenly inserts a "tab" character, Ctrl+O no longer opens an Outlook window, or other similar bugs occur.
There is already code in nsBaseAppShell::NativeEventCallback() that avoids pumping Windows messages by setting mBlockNativeEvent = PR_TRUE; when it detects that there is a non-mozilla modal loop, for example from a plug-in's dialog box or popup.
The attached diff fixes the problem for embedding scenarios.
Reproducible: Always
| Reporter | ||
Comment 1•16 years ago
|
||
Comment 2•16 years ago
|
||
Did you want someone to review or provide feedback on this patch? I'd suggest benjamin@smedbergs.us
| Reporter | ||
Comment 3•16 years ago
|
||
Attachment #461058 -
Attachment is obsolete: true
Attachment #461341 -
Flags: review?(benjamin)
Comment 4•16 years ago
|
||
Comment on attachment 461341 [details] [diff] [review]
An updated patch to remove the extraneous if statement
I don't own or know this code.
Attachment #461341 -
Flags: review?(benjamin) → review?(roc)
I think you should check mEventloopNestingState != eEventloopXPCOM. I think trying to break out of the XPCOM event loop would break non-embedders.
Comment on attachment 461341 [details] [diff] [review]
An updated patch to remove the extraneous if statement
See comment
Attachment #461341 -
Flags: review?(roc) → review-
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•