Closed tonsky closed 2 years ago
Seems that XI_Motion
disabling MotionNotify
is just A Thing (1, 2).
The simple thing is to just do the same thing on XI_Motion
that's on MotionNotify
(only one is active at a time, and scrolling and mouse movement get separate XI_Motion
events):
diff --git a/linux/cc/WindowManagerX11.cc b/linux/cc/WindowManagerX11.cc
index b73114f..afd7b88 100644
--- a/linux/cc/WindowManagerX11.cc
+++ b/linux/cc/WindowManagerX11.cc
@@ -332,6 +332,21 @@ void WindowManagerX11::_processXEvent(XEvent& ev) {
)
);
myWindow->dispatch(eventMouseScroll.get());
+ } else {
+ unsigned mask;
+ ::Window unused1;
+ int unused2;
+ XQueryPointer(display, myWindow->_x11Window, &unused1, &unused1, &unused2, &unused2, &unused2, &unused2, &mask);
+ jwm::JNILocal<jobject> eventMove(
+ app.getJniEnv(),
+ EventMouseMove::make(app.getJniEnv(),
+ deviceEvent->event_x,
+ deviceEvent->event_y,
+ jwm::MouseButtonX11::fromNativeMask(mask),
+ jwm::KeyX11::getModifiers()
+ )
+ );
+ myWindow->dispatch(eventMove.get());
}
break;
Thanks! Could you make it a PR?
Commenting out
XISetMask(mask, XI_Motion);
inWindowManagerX11.cc
fixes this. Of course that breakscase XI_Motion:
in_processXEvent
and thus scrolling, but at least the culprit is found.