X11: reduces selection fetcher timeout to 500ms jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 29 Sep 2017 08:01:04 +0100
branchjv
changeset 8187 03ebf4f9a91d
parent 8183 e1c6a2aa41b6
child 8188 00df122d8bd4
X11: reduces selection fetcher timeout to 500ms ...to avoid hangups. 500ms should be enough.
XWorkstation.st
--- a/XWorkstation.st	Thu Sep 14 09:55:57 2017 +0100
+++ b/XWorkstation.st	Fri Sep 29 08:01:04 2017 +0100
@@ -13643,34 +13643,36 @@
     incremental := false.
 
     [
-	|timeout|
-
-	display registerSelectionFetcher:self.
-
-	display
-	    requestSelection:aSelectionId
-	    type:aTargetId
-	    for:drawableID
-	    intoProperty:propertyID.
-
-	timeout := display xlibTimeout.
-	[
-	    |currentMessage|
-
-	    (sema waitWithTimeout:timeout) isNil ifTrue:[
-		"the selection owner didn't respond within reasonable time"
-		'XWorkstation(error): selection owner does not respond:' infoPrint. display infoPrintCR.
-		^ nil.
-	    ].
-	    currentMessage := message.
-	    message := nil.
-	    currentMessage notNil ifTrue:[currentMessage sendTo:self].
-	] doUntil:[done].
+        |timeout|
+
+        display registerSelectionFetcher:self.
+
+        display
+            requestSelection:aSelectionId
+            type:aTargetId
+            for:drawableID
+            intoProperty:propertyID.
+
+        timeout := 500"ms".
+        [
+            |currentMessage|
+
+            (sema waitWithTimeoutMs:timeout) isNil ifTrue:[
+                "the selection owner didn't respond within reasonable time"
+                'XWorkstation(error): selection owner does not respond:' infoPrint. display infoPrintCR.
+                ^ nil.
+            ].
+            currentMessage := message.
+            message := nil.
+            currentMessage notNil ifTrue:[currentMessage sendTo:self].
+        ] doUntil:[done].
     ] ensure:[
-	display unregisterSelectionFetcher:self.
+        display unregisterSelectionFetcher:self.
     ].
 
     ^ self getSelection
+
+    "Modified: / 29-09-2017 / 07:59:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !XWorkstation::SelectionFetcher methodsFor:'testing'!