#REFACTORING
authorStefan Vogel <sv@exept.de>
Fri, 08 Jan 2016 13:27:48 +0100
changeset 7092 9159201de216
parent 7091 ec9a7cdd2967
child 7093 913efc76315a
#REFACTORING class: XWorkstation changed: #eventPending #eventPendingWithSync: #eventQueuedAlready
XWorkstation.st
--- a/XWorkstation.st	Fri Jan 08 10:33:10 2016 +0100
+++ b/XWorkstation.st	Fri Jan 08 13:27:48 2016 +0100
@@ -5578,12 +5578,10 @@
     "/ where eventPending returns wrong if we do not flush the buffer.
     "/ (especially Win32 & Xlib)
 
-    ConservativeSync == true ifTrue:[self sync].
-
     dispatchingExpose notNil ifTrue:[
-	^ self exposeEventPendingFor:dispatchingExpose withSync:false
-    ].
-    ^ self eventPendingWithSync:false
+        ^ self exposeEventPendingFor:dispatchingExpose withSync:ConservativeSync
+    ].
+    ^ self eventPendingWithSync:ConservativeSync
 
     "Modified: / 28.4.1999 / 11:08:12 / cg"
 !
@@ -5638,20 +5636,20 @@
     OBJ rslt = false;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (XEventsQueued(dpy, QueuedAlready)) {
-	    RETURN (true);
-	}
-
-	ENTER_XLIB();
-	if (doSync == true) {
-	    XSync(dpy, 0);      /* make certain everything is flushed */
-	}
-	if (XPending(dpy)) {
-	    rslt = true;
-	}
-	LEAVE_XLIB();
+        Display *dpy = myDpy;
+
+        if (XEventsQueued(dpy, QueuedAlready)) {
+            RETURN (true);
+        }
+
+        ENTER_XLIB();
+        if (doSync == true) {
+            XSync(dpy, 0);      /* make certain everything is flushed */
+        }
+        if (XEventsQueued(dpy, QueuedAfterFlush)) {
+            rslt = true;
+        }
+        LEAVE_XLIB();
     }
     RETURN ( rslt );
 %}
@@ -5675,17 +5673,12 @@
       the display connection)."
 
 %{  /* UNLIMITEDSTACK */
-    OBJ rslt = false;
-
     if (ISCONNECTED) {
-	/* ENTER ... LEAVE not needed; XEventsQueued will not block */
-	/* ENTER_XLIB(); */
-	if (XEventsQueued(myDpy, QueuedAlready)) {
-	    rslt = true;
-	}
-	/* LEAVE_XLIB(); */
-    }
-    RETURN ( rslt );
+        if (XEventsQueued(myDpy, QueuedAlready)) {
+            RETURN(true);
+        }
+    }
+    RETURN ( false );
 %}
 !