I don't think we want to ignore virtual EnterNotify events.
As per the spec, those happen when the cursor moves from an ancestor of the Wine window directly to one of its children. AFAICT, the only potential child of a Wine whole window is a drawable client for OpenGL or Vulkan. So I think we only get a virtual EnterNotify in two cases:
1. When using a window manager that adds decoration, we get one when moving from that decoration directly to the client window.
2. In situations where the cursor starts over an ancestor of a Wine window and moves directly to the client window. This can happen, e.g., when running without a window manager (or with one that doesn't create a desktop). In that case, moving the cursor from the root window to the client window will be a virtual EnterNotify.
In both scenarios, ignoring the EnterNotify isn't usually a big deal, since there will be follow-up MotionNotify events. However, in case 2, if the window is mapped under the cursor and the user never moves the mouse, Wine is left very confused. (See MR !1250 for another attempted approach to that issue. There are other problems with the current approach, but I think this is correct regardless.)
If there are potentially other child windows, we could limit this to cases where the event's `subwindow` is equal to the driver's window data's `client_window`.
From: Tim Clem tclem@codeweavers.com
These represent the mouse entering a client window child, and if no MotionNotify events follow, we'll be left out of sync with X. --- dlls/winex11.drv/mouse.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 96be81df6e3..59dcba3c59d 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1811,7 +1811,6 @@ BOOL X11DRV_EnterNotify( HWND hwnd, XEvent *xev )
TRACE( "hwnd %p/%lx pos %d,%d detail %d\n", hwnd, event->window, event->x, event->y, event->detail );
- if (event->detail == NotifyVirtual) return FALSE; if (hwnd == x11drv_thread_data()->grab_hwnd) return FALSE;
/* simulate a mouse motion event */
This looks safe enough, and I don't think this can have a huge impact, but I have no idea how the mouse position mapping will behave exactly. There's plenty of different cases, and I'll have to spend some time to run a few tests.
This merge request was approved by Rémi Bernon.