Last Comment Bug 3546 - nsWindow.cpp incorrectly processes Window's events
: nsWindow.cpp incorrectly processes Window's events
Product: Core
Classification: Components
Component: Event Handling (show other bugs)
: Trunk
: x86 Windows NT
P1 normal (vote)
: M5
Assigned To: rods (gone)
: Jan Carpenter
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 1999-03-09 15:33 PST by tague
Modified: 1999-06-15 18:37 PDT (History)
0 users
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image tague 1999-03-09 15:33:41 PST
The Viewer application's event look (nsWinMain.cpp, nsNativeViewerApp::Run())
handles Window's messages incorrectly.  Viewer tries to handle keyboard events
prior to calling TranslateMessage, this prevents Input Methods from ever seeing
any keyboard events and sending the appropriate Messages to the application.

Input Methods have to have a chance at keyboard events (by calling
TranslateMessage) prior to all other keyboard processing.
Comment 1 User image leger 1999-03-10 16:58:59 PST
Putting on M3 radar whilst eng checks this out.  Moving to Events Handling
Comment 2 User image leger 1999-03-10 16:59:59 PST
Setting QA Contact to janc
Comment 3 User image tague 1999-03-30 12:42:59 PST
Tom :-

Per our hallway conversations, If you don't consider this your bug, please
comment and reassign.

Comment 4 User image tague 1999-03-30 16:06:59 PST
(1) Changed Summary of Bug
(2) changing owner from to per email from
Peter Trudelle

(3) More detailed information:
The bug with keyboard event processing in in the Window's Message Handler,
where it handles WM_KEYUP and WM_KEYDOWN events.  Normally, in a windows
application keyboard input is handled as WM_CHAR events or WM_IME_*COMPOSITION
messages - depending on if inline input is supported or not.

Right now the message handler for nsWindow.cpp is attempting to process key
events on the WM_KEY* messages and convert them into character events.  This
prevents international keyboards and input methods from working correctly.

When an input method is engaged, the WM_KEY* messages have to be given to the
DefWindowProc, so that the operating system can translate them into input
method messages.  Because nsWindow.cpp traps the WM_KEY* events, input methods
do not work properly.

Please contact me if you need more information about fixing this bug.
Comment 5 User image Peter Trudelle 1999-04-06 21:04:59 PDT
Is this is really only a Viewer bug? If so, shouldn't it be reassigned to someone
in Gecko?
Comment 6 User image bobj 1999-04-07 10:37:59 PDT
This is not a viewer-only bug.  Tague's early work was done on viewer because
Ender wasn't incorporated into apprunner at that time.  Tague is now doing his
work on apprunner, but the bug still applies to apprunner.

Didn't make it for M4.  Need this for M5 ASAP.
Comment 7 User image bobj 1999-04-07 17:31:59 PDT
Cross reference to related bug:
Comment 8 User image rods (gone) 1999-04-18 20:50:59 PDT
I didn't do anything with the IME code, but nsWindow (on Windows) is now
handling the WM_CHAR event.
Comment 9 User image tague 1999-06-15 18:37:59 PDT
fixed as part of large keyboard whackage.  marking verified.

Note You need to log in before you can comment on or make changes to this bug.