2002/08/07 04:33:57
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:49:40 +0000 (06:49 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:49:40 +0000 (06:49 +0000)
darcs-hash:20040130064940-2ba56-af034cfd89c9160c12f9cec66f5f73d9f425f253.gz

CHANGES
src/org/xwt/plat/AWT.java

diff --git a/CHANGES b/CHANGES
index a70c0de..99b6117 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 
 06-Jul megacz TinySSL.java: option to ignore untrusted certs, fixed GCJ bug
 
+06-Jul megacz AWT.java: removed blitDirtyScreenRegions() due to
+              deadlock, compensated for MacOSX button-swapping bug.
+
index 9b01d2f..eedfdc3 100644 (file)
@@ -69,8 +69,16 @@ public class AWT extends Platform {
     /** some platforms (cough, cough, NetscapeVM) have totally broken modifier masks; they will need to override this */
     protected static int modifiersToButtonNumber(int modifiers) {
         if ((modifiers & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) return 1;
-        if ((modifiers & InputEvent.BUTTON2_MASK) == InputEvent.BUTTON2_MASK) return 3;
-        if ((modifiers & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) return 2;
+        if ((modifiers & InputEvent.BUTTON2_MASK) == InputEvent.BUTTON2_MASK) {
+            // ugh, MacOSX reports the right mouse button as BUTTON2_MASK...
+            if (System.getProperty("os.name", "").startsWith("Mac OS X")) return 2;
+            return 3;
+        }
+        if ((modifiers & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) {
+            // ugh, MacOSX reports the right mouse button as BUTTON2_MASK...
+            if (System.getProperty("os.name", "").startsWith("Mac OS X")) return 3;
+            return 2;
+        }
         return 0;
     }
 
@@ -233,9 +241,6 @@ public class AWT extends Platform {
                     componentResized(window.getWidth() - insets.left - insets.right, window.getHeight() - insets.top - insets.bottom);
 
                 Dirty(r.x - insets.left, r.y - insets.top, r.width, r.height);
-
-                // this is safe because AWT's low-level drawing functions are threadsafe
-                blitDirtyScreenRegions();
             }
         }
 
@@ -245,9 +250,6 @@ public class AWT extends Platform {
             public void paint(Graphics gr) {
                 Rectangle r = gr.getClipBounds();
                 Dirty(r.x - insets.left, r.y - insets.top, r.width, r.height);
-
-                // this is safe because AWT's low-level drawing functions are threadsafe
-                blitDirtyScreenRegions();
             }
         }
 
@@ -343,7 +345,7 @@ public class AWT extends Platform {
 
             ourGraphics = null;
         }
-        
+
         public void keyTyped(KeyEvent k) { }
         public void keyPressed(KeyEvent k) { KeyPressed(translateKey(k)); }
         public void keyReleased(KeyEvent k) { KeyReleased(translateKey(k)); }