6660258: Java application stops Windows logout/shutdown (regression in 1.5.0_14)
authordcherepanov
Wed, 20 Jan 2010 01:33:49 +0300
changeset 4834 2571be1e8f1d
parent 4833 3410bf2a3349
child 4835 dad88ce69af3
6660258: Java application stops Windows logout/shutdown (regression in 1.5.0_14) Reviewed-by: anthony, art, uta
jdk/src/windows/native/sun/windows/awt_Component.cpp
jdk/src/windows/native/sun/windows/awtmsg.h
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp	Thu Jan 14 17:56:49 2010 +0300
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp	Wed Jan 20 01:33:49 2010 +0300
@@ -378,7 +378,9 @@
     TRY;
 
     AwtComponent * self = AwtComponent::GetComponentImpl(hWnd);
-    if (self == NULL || self->GetHWnd() != hWnd) {
+    if (self == NULL || self->GetHWnd() != hWnd ||
+        message == WM_UNDOCUMENTED_CLIENTSHUTDOWN) // handle log-off gracefully
+    {
         return ComCtl32Util::GetInstance().DefWindowProc(NULL, hWnd, message, wParam, lParam);
     } else {
         return self->WindowProc(message, wParam, lParam);
--- a/jdk/src/windows/native/sun/windows/awtmsg.h	Thu Jan 14 17:56:49 2010 +0300
+++ b/jdk/src/windows/native/sun/windows/awtmsg.h	Wed Jan 20 01:33:49 2010 +0300
@@ -253,4 +253,8 @@
 #define WM_UNDOCUMENTED_CLICKMENUBAR 0x0313
 #endif
 
+#ifndef WM_UNDOCUMENTED_CLIENTSHUTDOWN
+#define WM_UNDOCUMENTED_CLIENTSHUTDOWN 0x003b
+#endif
+
 #endif  // AWTMSG_H