Bug 340054 - SWT Painting problems in Cocoa
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index 48f1707..62ad825 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -2285,6 +2285,10 @@
return true;
}
+boolean isResizing () {
+ return (state & RESIZING) != 0 || parent.isResizing();
+}
+
boolean isShowing () {
/*
* This is not complete. Need to check if the
@@ -3796,7 +3800,10 @@
super.setFrameSize(id, sel, size);
if (frame.width != size.width || frame.height != size.height) {
invalidateVisibleRegion();
+ boolean oldResizing = (state & RESIZING) != 0;
+ state |= RESIZING;
resized ();
+ if (!oldResizing) state &= ~RESIZING;
}
}
@@ -4885,6 +4892,7 @@
void update (boolean all) {
// checkWidget();
if (display.isPainting.containsObject(view)) return;
+ if (isResizing()) return;
Shell shell = getShell();
NSWindow window = shell.deferFlushing && shell.scrolling ? view.window() : null;
try {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
index 5149908..d810b81 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
@@ -1230,6 +1230,10 @@
return true;
}
+boolean isResizing () {
+ return (state & RESIZING) != 0;
+}
+
boolean isTransparent() {
return false;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
index 593c80f..872dde2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
@@ -78,6 +78,7 @@
static final int DISPOSE_SENT = 1<<16;
static final int FOREIGN_HANDLE = 1<<17;
static final int DRAG_DETECT = 1<<18;
+ static final int RESIZING = 1<<19;
/* WebKit fixes */
static final int WEBKIT_EVENTS_FIX = 1<<19;