This fixes two issues in Component:
- setBackground should not make the component inherit its background from
the parent. This bug showed up in an application we tested.
- I made the event system handle mouse events and mouse motion events
separately. This really belongs to my previous Container fixup
2005-11-17 Roman Kennke <[EMAIL PROTECTED]>
* java/awt/Component.java
(setBackground): Don't inherit background from parent.
(addMouseMotionListener): Enable MOUSE_MOTION_EVENT_MASK instead
of MOUSE_EVENT_MASK.
(eventTypeEnabled): Handle mouse events and mouse motion events
separately.
/Roman
Index: java/awt/Component.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
retrieving revision 1.87
diff -u -r1.87 Component.java
--- java/awt/Component.java 17 Nov 2005 20:39:56 -0000 1.87
+++ java/awt/Component.java 18 Nov 2005 22:09:45 -0000
@@ -1038,14 +1038,10 @@
if ((c != null) && c.equals(background))
return;
- // If c is null, inherit from closest ancestor whose bg is set.
- if (c == null && parent != null)
- c = parent.getBackground();
- if (peer != null && c != null)
- peer.setBackground(c);
-
Color previous = background;
background = c;
+ if (peer != null && c != null)
+ peer.setBackground(c);
firePropertyChange("background", previous, c);
}
@@ -2642,7 +2638,7 @@
{
mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener);
if (mouseMotionListener != null)
- enableEvents(AWTEvent.MOUSE_EVENT_MASK);
+ enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
}
/**
@@ -4853,11 +4849,12 @@
case MouseEvent.MOUSE_EXITED:
case MouseEvent.MOUSE_PRESSED:
case MouseEvent.MOUSE_RELEASED:
- case MouseEvent.MOUSE_MOVED:
- case MouseEvent.MOUSE_DRAGGED:
return (mouseListener != null
- || mouseMotionListener != null
|| (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0);
+ case MouseEvent.MOUSE_MOVED:
+ case MouseEvent.MOUSE_DRAGGED:
+ return (mouseMotionListener != null
+ || (eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0);
case FocusEvent.FOCUS_GAINED:
case FocusEvent.FOCUS_LOST:
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches