Skip to content

Commit

Permalink
X11: Fix EventMouseMove when no mouse button is held (closes #146)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaima authored and tonsky committed Jan 31, 2022
1 parent 3f6006b commit 09a1399
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion linux/cc/WindowManagerX11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,22 @@ void WindowManagerX11::_processXEvent(XEvent& ev) {
jwm::KeyX11::getModifiers()
)
);
myWindow->dispatch(eventMouseScroll.get());
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;
Expand Down

0 comments on commit 09a1399

Please sign in to comment.