Author: [EMAIL PROTECTED]
Date: Thu Oct 23 07:38:28 2008
New Revision: 3824

Modified:
    branches/1_6_events/user/src/com/google/gwt/user/client/ui/Widget.java

Log:
Fixed a bug in Widget.onAttach() where we do not update eventsToSink, which  
makes subsequent attempts to sinkEvents fail to actually sink the DOM event  
on the element.

Patch by: jlabanca



Modified:  
branches/1_6_events/user/src/com/google/gwt/user/client/ui/Widget.java
==============================================================================
--- branches/1_6_events/user/src/com/google/gwt/user/client/ui/Widget.java      
 
(original)
+++ branches/1_6_events/user/src/com/google/gwt/user/client/ui/Widget.java      
 
Thu Oct 23 07:38:28 2008
@@ -30,7 +30,11 @@
   * [EMAIL PROTECTED] com.google.gwt.user.client.ui.Panel panels}.
   */
  public class Widget extends UIObject implements EventListener {
-  private int sunkEvents;
+  /**
+   * A bit-map of the events that should be sunk when the widget is  
attached
+   * to the DOM.  We delay the sinking of events to improve startup  
performance.
+   */
+  private int eventsToSink;
    private boolean attached;

    private Object layoutData;
@@ -81,10 +85,10 @@

    @Override
    public void sinkEvents(int eventBitsToAdd) {
-    if (sunkEvents == -1) {
+    if (eventsToSink == -1) {
        super.sinkEvents(eventBitsToAdd);
      } else {
-      sunkEvents |= eventBitsToAdd;
+      eventsToSink |= eventBitsToAdd;
      }
    }

@@ -188,10 +192,10 @@

      attached = true;
      DOM.setEventListener(getElement(), this);
-    if (sunkEvents > 0) {
-      super.sinkEvents(sunkEvents);
-      sunkEvents = -1;
+    if (eventsToSink > 0) {
+      super.sinkEvents(eventsToSink);
      }
+    eventsToSink = -1;
      doAttachChildren();

      // onLoad() gets called only *after* all of the children are attached  
and

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to