Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2003-10-06 17:54:50 +0000
committerVeronika Irvine2003-10-06 17:54:50 +0000
commit45b1561398a90cbad1f5547f03d92bd48ffc136c (patch)
tree80b605b26cad75b9190a97d14f76ca690f51c448
parent8f1164987597bdcfb3f7ffdca71e5b39dcf3a485 (diff)
downloadeclipse.platform.swt-45b1561398a90cbad1f5547f03d92bd48ffc136c.tar.gz
eclipse.platform.swt-45b1561398a90cbad1f5547f03d92bd48ffc136c.tar.xz
eclipse.platform.swt-45b1561398a90cbad1f5547f03d92bd48ffc136c.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java
index 9c2983f32a..5d8e0ac58e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java
@@ -813,6 +813,22 @@ int kEventWindowGetRegion (int nextHandler, int theEvent, int userData) {
case OS.kWindowStructureRgn:
OS.RectRgn (hRegion, clipRect);
OS.SectRgn (hRegion, clipRgn, hRegion);
+ /*
+ * Bug in the Macintosh. In kEventWindowGetRegion,
+ * Carbon assumes the origin of the Region is (0, 0)
+ * and ignores the actual origin. This causes the
+ * window to be shifted. The fix is to modify the origin.
+ */
+ // TODO - find a better fix
+ Rect r = new Rect ();
+ OS.GetRegionBounds (hRegion, r);
+ if (r.left != 0 || r.top != 0) {
+ OS.SetRect (r, (short)0, (short)0, (short)1, (short)1);
+ int rectRgn = OS.NewRgn ();
+ OS.RectRgn (rectRgn, r);
+ OS.UnionRgn (rectRgn, hRegion, hRegion);
+ OS.DisposeRgn (rectRgn);
+ }
return OS.noErr;
default:
OS.DiffRgn (hRegion, hRegion, hRegion);
@@ -1056,22 +1072,6 @@ public void setClipping(Region region) {
OS.SetRect (clipRect, (short) 0, (short) 0, (short) (clipRect.right - clipRect.left), (short) (clipRect.bottom - clipRect.top));
clipRgn = OS.NewRgn ();
OS.CopyRgn (region.handle, clipRgn);
- /*
- * Bug in the Macintosh. In kEventWindowGetRegion,
- * Carbon assumes the origin of the Region is (0, 0)
- * and ignores the actual origin. This causes the
- * window to be shifted. The fix is to modify the origin.
- */
- // TODO - find a better fix
- Rect r = new Rect ();
- OS.GetRegionBounds (clipRgn, r);
- if (r.left != 0 || r.top != 0) {
- OS.SetRect (r, (short)0, (short)0, (short)1, (short)1);
- int rectRgn = OS.NewRgn ();
- OS.RectRgn (rectRgn, r);
- OS.UnionRgn (rectRgn, clipRgn, clipRgn);
- OS.DisposeRgn (rectRgn);
- }
}
OS.ReshapeCustomWindow (shellHandle);
}

Back to the top