The Inbox: Morphic-ct.2225.mcz

[email protected] Wed, 29 Jul 2026 01:23:01 0000
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <[email protected]>
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.2225.mcz

==================== Summary ====================

Name: Morphic-ct.2225
Author: ct
Time: 29 July 2026, 3:23:00.200443 am
UUID: c00483c1-7abd-4d25-8c7f-3d4f4acdcdc1
Ancestors: Morphic-mt.2222

Workaround for redundant WindowEventDeactivated/WindowEventActivated events on Linux with XWayland. Needs more testing (or obviously, preferably a fix in the VM). See: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/777

=============== Diff against Morphic-mt.2222 ===============

Item was changed:
  ----- Method: HandMorph>>generateWindowEvent: (in category 'private events') -----
  generateWindowEvent: evtBuf 
  	"Generate the appropriate window event for the given raw event buffer"
  
  	| evt |
+ 	(evtBuf third = 4 or: [evtBuf third = 7]) ifTrue:
+ 		[| nextOrNil next nextWindow |
+ 		self flag: #workaround. "Workaround for Linux VM bug on XWayland, where mouse clicks and focus switches emit redundant windowDeactivated/windowActivated events. For now, ignore all but the last event in a series of equal timestamps. See: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/777"
+ 		[nextWindow := nil.
+ 		(nextOrNil := Sensor peekEvent) notNil
+ 			and: [nextOrNil first = evtBuf first and: [nextOrNil second = evtBuf second] and:
+ 				[nextWindow := nextOrNil.
+ 				next := nil.
+ 				nextOrNil third = 4 or: [nextOrNil third = 7]]]]
+ 					whileTrue: [next := nextOrNil. Sensor nextEvent].
+ 		nextWindow ifNotNil: [Sensor nextEvent].
+ 		next ifNotNil:
+ 			[^ next third = evtBuf third ifTrue: [self generateWindowEvent: next]]].
+ 	
  	evt := WindowEvent new.
  	evt setHand: self.
  	evt setTimeStamp: evtBuf second.
  	evt timeStamp = 0 ifTrue: [evt setTimeStamp: Sensor eventTimeNow].
  	evt action: evtBuf third.
  	evt rectangle: (Rectangle origin: evtBuf fourth @ evtBuf fifth corner: evtBuf sixth @ evtBuf seventh ).
  	
  	^evt!

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]