Fix Drag'n'Drop under X11 jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 22 Feb 2016 14:33:39 +0000
branchjv
changeset 7158 ce64e30ecf54
parent 7155 efc70ec17284
child 7159 d5a37dad93be
Fix Drag'n'Drop under X11
DisplayRootView.st
--- a/DisplayRootView.st	Mon Feb 22 09:06:26 2016 +0000
+++ b/DisplayRootView.st	Mon Feb 22 14:33:39 2016 +0000
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libview' }"
 
+"{ NameSpace: Smalltalk }"
+
 DisplaySurface subclass:#DisplayRootView
 	instanceVariableNames:''
 	classVariableNames:''
@@ -84,7 +86,7 @@
     [author:]
         Claus Gittinger
 "
-!
+! !
 
 !DisplayRootView class methodsFor:'instance creation'!
 
@@ -152,6 +154,25 @@
     "ignored"
 ! !
 
+!DisplayRootView methodsFor:'event handling'!
+
+waitForExpose
+    "wait until an expose event arrives (to wait for scroll-finish)"
+
+    "/ JV@2016-02-22: On X11, expose for root window may not arrive at all
+    "/ causing 3 seconds delay. Worse, this breaks drag'n'drop.
+    "/ The reason is that when running under compositing window manager, 
+    "/ (such as GNOME shell or KWM), window contents ir rendered to an
+    "/ off-screen pixmap so expose events are lot less common and may
+    "/ not arrive.
+    self graphicsDevice isX11Platform ifTrue:[ 
+        ^ self.
+    ].
+    super waitForExpose.
+
+    "Created: / 22-02-2016 / 14:24:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !DisplayRootView methodsFor:'hotkeys'!
 
 addHotKeyHandler:handler forKey:aKey modifierMask:optionalModifierMaskOrNil
@@ -295,5 +316,10 @@
 
 version
     ^ '$Header$'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !