summaryrefslogtreecommitdiffstats
path: root/ui/platform_window/x11
diff options
context:
space:
mode:
authorkylechar <kylechar@chromium.org>2016-02-26 06:47:08 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-26 14:48:19 +0000
commitbb737c47eacb3f83ee75099f1aee0ce6ed63445b (patch)
tree50250d13b38296693b3caecaa1925291c6402f99 /ui/platform_window/x11
parenta5c22eadcefaa06df258876f6d43edf8d9e44269 (diff)
downloadchromium_src-bb737c47eacb3f83ee75099f1aee0ce6ed63445b.zip
chromium_src-bb737c47eacb3f83ee75099f1aee0ce6ed63445b.tar.gz
chromium_src-bb737c47eacb3f83ee75099f1aee0ce6ed63445b.tar.bz2
Fix double click on Ozone X11.
Double click is broken on Ozone X11. First, the constructor used by Ozone X11 doesn't call MouseEvent::IsRepeatedClickEvent() to check for double click events. The constructor version that takes a base::NativeEvent is what makes these checks. We can't add the check to the manual constructor because tests use it and assume the checks don't happen. Also, many other event types of have similar checks in only the base::NativeEvent constructor. Make a copy using the base::NativeEvent constructor to trigger the appropriate checks. Second, the ui::Event need to be copied before being dispatched to aura as aura may modify it. This breaks double click when the modified event is later copied and global state is set based on the modified event instead of the original event. BUG=589571 Review URL: https://codereview.chromium.org/1739433002 Cr-Commit-Position: refs/heads/master@{#377883}
Diffstat (limited to 'ui/platform_window/x11')
-rw-r--r--ui/platform_window/x11/x11_window_ozone.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/platform_window/x11/x11_window_ozone.cc b/ui/platform_window/x11/x11_window_ozone.cc
index 223291c..3a370dc 100644
--- a/ui/platform_window/x11/x11_window_ozone.cc
+++ b/ui/platform_window/x11/x11_window_ozone.cc
@@ -47,8 +47,11 @@ bool X11WindowOzone::CanDispatchEvent(const PlatformEvent& event) {
}
uint32_t X11WindowOzone::DispatchEvent(const PlatformEvent& platform_event) {
- Event* event = static_cast<Event*>(platform_event);
- delegate()->DispatchEvent(event);
+ // This is unfortunately needed otherwise events that depend on global state
+ // (eg. double click) are broken.
+ DispatchEventFromNativeUiEvent(
+ platform_event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
+ base::Unretained(delegate())));
return POST_DISPATCH_STOP_PROPAGATION;
}