<AWT Dev> Code Review Request for CR 7024749 - JDK7 b131---a crash in: Java_sun_awt_windows_ThemeReader_isGetThemeTransitionDurationDefined+0x75

Oleg Pekhovskiy oleg.pekhovskiy at oracle.com
Thu Apr 19 06:41:59 PDT 2012


Hi!

Please review the fix for this CR:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7024749

Webrev:
http://cr.openjdk.java.net/~bagiras/8/7024749.1

The idea of this fix based on IMM interaction theory (from MSDN) and 
actual implementation in AWT.

AWT creates its own IME context. It is shared between all AWT windows.
This context is associated with window each time it receives WM_ACTIVATE 
message (which surplus but not critical).
WM_IME_SETCONTEXT and WM_IME_NOTIFY (with INM_OPENSTATUSWINDOW) messages 
apply to all AWT windows and usually are sent to the top-level window.
So there is no need to send them to the focus proxy.
That's why I removed CallProxyDefWindowProc() from their handlers in 
AwtComponent::WindowProc().
I also removed switch cases for those messages from 
AwtFrame::ProxyWindowProc() because they didn't make any sense there.
Thus, only IME messages between WM_IME_STARTCOMPOSITION and 
WM_IME_ENDCOMPOSITION are sent to the proxy focus owner - that's a 
typing period.

I changed all places where IME context was used according to MSDN notes:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd318639(v=vs.85).aspx
"The application retrieves the handle by using the ImmGetContext 
function. It can use the retrieved handle in subsequent calls to the IMM 
functions
to retrieve and set IME values, such as the composition window style, 
the composition style, and the status window position.
Once the application has finished using the context, it must release the 
context using the ImmReleaseContext function."

All changes were tested by the regression tests in 'test/java/awt/Focus' 
and all JCK tests.
I also tested them on hierarchy of owned windows with different 
enabled/disabled states.
No bad influence was found. From that point of view it is safe.

Thanks,
Oleg



More information about the awt-dev mailing list