diff options
author | Steve Northover <steve> | 2002-03-14 18:46:49 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2002-03-14 18:46:49 +0000 |
commit | 48512dc20e32e369917d3e1ccfb92109c9724e7e (patch) | |
tree | a8bfb6b7976d15c393333ff28cdfc9d01c6e9437 | |
parent | b31efafa505975e95e1ddac261bf4b16fa903e0f (diff) | |
download | eclipse.platform.swt-48512dc20e32e369917d3e1ccfb92109c9724e7e.tar.gz eclipse.platform.swt-48512dc20e32e369917d3e1ccfb92109c9724e7e.tar.xz eclipse.platform.swt-48512dc20e32e369917d3e1ccfb92109c9724e7e.zip |
merge paints
5 files changed, 66 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/swt.c index 664d3eb78e..5d0a75df4c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/swt.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/library/swt.c @@ -8882,3 +8882,40 @@ JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS__1XmSetMenuTravers _XmSetMenuTraversal ((Widget) menu, traversal); } + +/* + * Class: org_eclipse_swt_internal_motif_OS + * Method: XEventsQueued + */ +JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XEventsQueued + (JNIEnv *env, jclass that, jint display, jint mode) +{ + +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "XEventsQueued\n"); +#endif + + return (jint) XEventsQueued ((Display *) display, mode); +} + +/* + * Class: org_eclipse_swt_internal_motif_OS + * Method: memmove + * Signature: (ILorg/eclipse/swt/internal/motif/XExposeEvent;I)V + */ +JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_memmove__ILorg_eclipse_swt_internal_motif_XExposeEvent_2I + (JNIEnv *env, jclass that, jint dest, jobject src, jint count) +{ + DECL_GLOB(pGlob) + XEvent xEvent, *src1=NULL; + +#ifdef DEBUG_CALL_PRINTS + fprintf(stderr, "memmove__ILorg_eclipse_swt_internal_motif_XExposeEvent_2I\n"); +#endif + if (src) { + src1=&xEvent; + cacheXexposeeventFids(env, src, &PGLOB(XexposeeventFc)); + getXexposeeventFields(env, src, src1, &PGLOB(XexposeeventFc)); + } + memmove((void *)dest, (void *)src1, count); +}
\ No newline at end of file diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java index d26466cf15..fcd6f2f3ea 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/motif/org/eclipse/swt/internal/motif/OS.java @@ -38,6 +38,13 @@ public class OS { }
/*
+ * Added for XEventsQueued.
+ */
+// public static final int QueuedAlready = 0;
+ public static final int QueuedAfterReading = 1;
+// public static final int QueuedAfterFlush = 2
+
+ /*
* Added for XmNpopupEnabled.
*/
// public static final int XmPOPUP_DISABLED = 0;
@@ -1399,4 +1406,6 @@ public static final synchronized native void XtInsertEventHandler (int w, int ev //public static final synchronized native void XmRemoveFromPostFromList (int menu, int post_from_list);
//public static final synchronized native void XmMenuPosition (int menu, int event);
public static final synchronized native void _XmSetMenuTraversal (int menu, boolean traversal);
+public static final synchronized native int XEventsQueued (int display, int mode);
+public static final native void memmove (int dest, XExposeEvent src, int count);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java index a31d9309b4..4d6d879e6b 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java @@ -445,12 +445,21 @@ int processPaint (int callData) { OS.memmove (xEvent, callData, XExposeEvent.sizeof);
int exposeCount = xEvent.count;
if (exposeCount == 0) {
- XAnyEvent event = new XAnyEvent ();
- Display display = getDisplay ();
- display.exposeCount = 0;
- int checkExposeProc = display.checkExposeProc;
- OS.XCheckIfEvent (xEvent.display, event, checkExposeProc, xEvent.window);
- exposeCount = display.exposeCount;
+ if (OS.XEventsQueued (xEvent.display, OS.QueuedAfterReading) != 0) {
+ XAnyEvent xAnyEvent = new XAnyEvent ();
+ Display display = getDisplay ();
+ display.exposeCount = display.lastExpose = 0;
+ int checkExposeProc = display.checkExposeProc;
+ OS.XCheckIfEvent (xEvent.display, xAnyEvent, checkExposeProc, xEvent.window);
+ exposeCount = display.exposeCount;
+ int lastExpose = display.lastExpose;
+ if (exposeCount != 0 && lastExpose != 0) {
+ XExposeEvent xExposeEvent = display.xExposeEvent;
+ OS.memmove (xExposeEvent, lastExpose, XExposeEvent.sizeof);
+ xExposeEvent.count = 0;
+ OS.memmove (lastExpose, xExposeEvent, XExposeEvent.sizeof);
+ }
+ }
}
if (exposeCount == 0 && damagedRegion == 0) {
return super.processPaint (callData);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java index 55e8464e60..3317f3e9eb 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java @@ -235,7 +235,7 @@ public class Display extends Device { /* Check Expose Proc */
Callback checkExposeCallback;
- int checkExposeProc, exposeCount;
+ int checkExposeProc, exposeCount, lastExpose;
XExposeEvent xExposeEvent = new XExposeEvent ();
/* Check Resize Proc */
@@ -360,6 +360,7 @@ int caretProc (int clientData, int id) { }
return 0;
}
+
int checkExposeProc (int display, int event, int window) {
OS.memmove (xExposeEvent, event, XExposeEvent.sizeof);
if (xExposeEvent.window != window) return 0;
@@ -367,6 +368,9 @@ int checkExposeProc (int display, int event, int window) { case OS.Expose:
case OS.GraphicsExpose:
exposeCount++;
+ lastExpose = event;
+ xExposeEvent.count = 1;
+ OS.memmove (event, xExposeEvent, XExposeEvent.sizeof);
break;
}
return 0;
diff --git a/bundles/org.eclipse.swt/os/linux/x86/libswt-motif-2030.so b/bundles/org.eclipse.swt/os/linux/x86/libswt-motif-2030.so Binary files differindex 140b74a433..2707863ace 100644 --- a/bundles/org.eclipse.swt/os/linux/x86/libswt-motif-2030.so +++ b/bundles/org.eclipse.swt/os/linux/x86/libswt-motif-2030.so |