Merge
authortbell
Thu, 12 Jun 2008 13:18:01 -0700
changeset 698 d65966c07e62
parent 697 fb86c99b92a2 (current diff)
parent 641 f86f33cf2256 (diff)
child 700 b4f4e049622a
Merge
--- a/jdk/.hgtags	Tue Jun 10 13:50:06 2008 +0200
+++ b/jdk/.hgtags	Thu Jun 12 13:18:01 2008 -0700
@@ -2,3 +2,4 @@
 75fca0b0ab83ab1392e615910cea020f66535390 jdk7-b25
 fb57027902e04ecafceae31a605e69b436c23d57 jdk7-b26
 3e599d98875ddf919c8ea11cff9b3a99ba631a9b jdk7-b27
+02e4c5348592a8d7fc2cba28bc5f8e35c0e17277 jdk7-b28
--- a/jdk/src/share/classes/java/awt/Component.java	Tue Jun 10 13:50:06 2008 +0200
+++ b/jdk/src/share/classes/java/awt/Component.java	Thu Jun 12 13:18:01 2008 -0700
@@ -3057,10 +3057,24 @@
             // services.  Additionally, the request is restricted to
             // the bounds of the component.
             if (parent != null) {
-                int px = this.x + ((x < 0) ? 0 : x);
-                int py = this.y + ((y < 0) ? 0 : y);
+                if (x < 0) {
+                    width += x;
+                    x = 0;
+                }
+                if (y < 0) {
+                    height += y;
+                    y = 0;
+                }
+
                 int pwidth = (width > this.width) ? this.width : width;
                 int pheight = (height > this.height) ? this.height : height;
+
+                if (pwidth <= 0 || pheight <= 0) {
+                    return;
+                }
+
+                int px = this.x + x;
+                int py = this.y + y;
                 parent.repaint(tm, px, py, pwidth, pheight);
             }
         } else {
--- a/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java	Tue Jun 10 13:50:06 2008 +0200
+++ b/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java	Thu Jun 12 13:18:01 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -485,7 +485,6 @@
 
         Cursor c = null;
 
-        targetAct = DnDConstants.ACTION_NONE;
         switch (status) {
             case ENTER:
             case OVER:
@@ -507,6 +506,10 @@
                     else
                         c = DragSource.DefaultCopyDrop;
                 }
+                break;
+            default:
+                targetAct = DnDConstants.ACTION_NONE;
+
         }
 
         setCursorImpl(c);
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp	Tue Jun 10 13:50:06 2008 +0200
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp	Thu Jun 12 13:18:01 2008 -0700
@@ -3464,6 +3464,21 @@
     return java_awt_event_KeyEvent_VK_UNDEFINED;
 }
 
+BOOL AwtComponent::IsNavigationKey(UINT wkey) {
+    switch (wkey) {
+      case VK_END:
+      case VK_PRIOR:  // PageUp
+      case VK_NEXT:  // PageDown
+      case VK_HOME:
+      case VK_LEFT:
+      case VK_UP:
+      case VK_RIGHT:
+      case VK_DOWN:
+          return TRUE;
+    }
+    return FALSE;
+}
+
 // determine if a key is a numpad key (distinguishes the numpad
 // arrow keys from the non-numpad arrow keys, for example).
 BOOL AwtComponent::IsNumPadKey(UINT vkey, BOOL extended)
@@ -3563,7 +3578,10 @@
         // fix for 4623376,4737679,4501485,4740906,4708221 (4173679/4122715)
         // Here we try to resolve a conflict with ::ToAsciiEx's translating
         // ALT+number key combinations. kdm@sarc.spb.su
-        keyboardState[VK_MENU] &= ~KEY_STATE_DOWN;
+        // yan: Do it for navigation keys only, otherwise some AltGr deadkeys fail.
+        if( IsNavigationKey(wkey) ) {
+            keyboardState[VK_MENU] &= ~KEY_STATE_DOWN;
+        }
 
         if (ctrlIsDown)
         {
--- a/jdk/src/windows/native/sun/windows/awt_Component.h	Tue Jun 10 13:50:06 2008 +0200
+++ b/jdk/src/windows/native/sun/windows/awt_Component.h	Thu Jun 12 13:18:01 2008 -0700
@@ -823,6 +823,7 @@
 private:
     AwtComponent* SearchChild(UINT id);
     void RemoveChild(UINT id) ;
+    static BOOL IsNavigationKey(UINT wkey);
 
     ChildListItem* m_childList;