summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/aura/desktop_host_linux.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/ui/aura/desktop_host_linux.cc b/ui/aura/desktop_host_linux.cc
index 65cee8b..06030b7 100644
--- a/ui/aura/desktop_host_linux.cc
+++ b/ui/aura/desktop_host_linux.cc
@@ -88,13 +88,32 @@ base::MessagePumpDispatcher::DispatchStatus DesktopHostLinux::Dispatch(
break;
}
case ButtonPress:
- case ButtonRelease:
+ case ButtonRelease: {
+ MouseEvent mouseev(xev);
+ handled = desktop_->OnMouseEvent(mouseev);
+ break;
+ }
case MotionNotify: {
+ // Discard all but the most recent motion event that targets the same
+ // window with unchanged state.
+ XEvent last_event;
+ while (XPending(xev->xany.display)) {
+ XEvent next_event;
+ XPeekEvent(xev->xany.display, &next_event);
+ if (next_event.type == MotionNotify &&
+ next_event.xmotion.window == xev->xmotion.window &&
+ next_event.xmotion.subwindow == xev->xmotion.subwindow &&
+ next_event.xmotion.state == xev->xmotion.state) {
+ XNextEvent(xev->xany.display, &last_event);
+ xev = &last_event;
+ } else {
+ break;
+ }
+ }
MouseEvent mouseev(xev);
handled = desktop_->OnMouseEvent(mouseev);
break;
}
-
case ConfigureNotify: {
DCHECK_EQ(xdisplay_, xev->xconfigure.display);
DCHECK_EQ(xwindow_, xev->xconfigure.window);