Support for mouse motion events was already implemented with
b70cd16c42914b617e770ad76a8e951fa6ebf325. However, following
edge cases were missed:
- Moving the cursor out of the shell and back in doesn't fire a "mouse
enter" event.
Similarly to the way motion events are handled in GTK3, the current
control needs to be cleared on a "leave" event. Otherwise the "enter"
event is suppressed when the cursor is moved out of and back in a shell
again.
- Moving from one widget to another fires two "mouse exit" events.
One event is fired by "gtk4_motion_event()", the other by "leaveProc()".
Only the former should be fired, as it contains the proper "x" and "y"
coordinates.
Latter is fired because "getCursorControl()" always returns "null". This
has been fixed by first calculating the GtkWindow from the GdkSurface
and then selecting the widget at the mouse coordinates. The whole
implementation has also been restructured so that the X11-based
heuristic via the XQueryPointer is only used for GTK3 (because it would
simply return early for GTK4 anyway).
- The tooltip window isn't moved when hovering over different widgets
This is because the tooltip is set for the shell, even though it should
be set for the individual widgets. As a result, only the text is updated
but the window remains where it was initially shown.
Closes https://github.com/eclipse-platform/eclipse.platform.swt/issues/219