Skip to content

Commit 8df0948

Browse files
joel-majanoakurtakov
authored andcommitted
Bug 576215 - [Wayland] Mouse events not received as on other platforms
This patch addresses mouse events not being the same between x11 and Wayland. The issue was MouseMove events were being left out of the queue which prevented them from being sent out. Passes AllNonBrowserTests and DnD example works as expected. The Wayland behavior is not 100% the same as x11 due to the initial MouseDown event being cached before being sent out. However, as soon as the mouse begins to move, the down message pops up, and the behavior is as expected. Change-Id: I090953be3bf592c4161ec497a53e47964904fe45 Signed-off-by: jmajano <[email protected]> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/186019 Tested-by: Platform Bot <[email protected]> Reviewed-by: Alexander Kurtakov <[email protected]>
1 parent b4732a3 commit 8df0948

File tree

1 file changed

+7
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+7
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4999,7 +4999,13 @@ boolean sendMouseEvent (int type, int button, int count, int detail, boolean sen
49994999
sendOrPost(SWT.MouseDown, mouseDownEvent);
50005000
}
50015001
}
5002-
return true;
5002+
/* This checks for Wayland, a previous MouseDown || MouseMove in the
5003+
* dragDetectionQueue and it checks if the current event is MouseMove
5004+
* This will prevent them from not being queued, which caused
5005+
* Bug 576215 - [Wayland] Mouse events not received as on other platforms.
5006+
* In x11 this will always return true as before.
5007+
*/
5008+
if( (OS.isX11() || (dragDetectionQueue == null) || (type != SWT.MouseMove)) ) return true;
50035009
}
50045010
Event event = new Event ();
50055011
event.time = time;

0 commit comments

Comments
 (0)