Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1624)

Unified Diff: ui/aura/test/ui_controls_factory_aurax11.cc

Issue 149743006: Fix crash of OmniboxViewViewsTest.SelectAllOnClick on Linux Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/view_event_test_base.cc ('k') | ui/views/test/ui_controls_factory_desktop_aurax11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/ui_controls_factory_aurax11.cc
diff --git a/ui/aura/test/ui_controls_factory_aurax11.cc b/ui/aura/test/ui_controls_factory_aurax11.cc
index dffea4a5b2fcf40f5494962e45c6efbdeb075a29..d505e3642c226f823f5a51ddf5ebc1a6801e6a22 100644
--- a/ui/aura/test/ui_controls_factory_aurax11.cc
+++ b/ui/aura/test/ui_controls_factory_aurax11.cc
@@ -141,23 +141,32 @@ class UIControlsX11 : public UIControlsAura {
long screen_x,
long screen_y,
const base::Closure& closure) OVERRIDE {
- gfx::Point root_point(screen_x, screen_y);
+ gfx::Point root_location(screen_x, screen_y);
aura::client::ScreenPositionClient* screen_position_client =
aura::client::GetScreenPositionClient(root_window_->window());
if (screen_position_client) {
screen_position_client->ConvertPointFromScreen(root_window_->window(),
- &root_point);
+ &root_location);
}
+ gfx::Point root_current_location;
+ root_window_->host()->QueryMouseLocation(&root_current_location);
+ root_window_->host()->ConvertPointFromHost(&root_current_location);
- XEvent xevent = {0};
- XMotionEvent* xmotion = &xevent.xmotion;
- xmotion->type = MotionNotify;
- xmotion->x = root_point.x();
- xmotion->y = root_point.y();
- xmotion->state = button_down_mask;
- xmotion->same_screen = True;
- // RootWindow will take care of other necessary fields.
- root_window_->host()->PostNativeEvent(&xevent);
+ if (root_location != root_current_location && button_down_mask == 0) {
+ // Move the cursor because EnterNotify/LeaveNotify are generated with the
+ // current mouse position as a result of XGrabPointer()
+ root_window_->window()->MoveCursorTo(root_location);
+ } else {
+ XEvent xevent = {0};
+ XMotionEvent* xmotion = &xevent.xmotion;
+ xmotion->type = MotionNotify;
+ xmotion->x = root_location.x();
+ xmotion->y = root_location.y();
+ xmotion->state = button_down_mask;
+ xmotion->same_screen = True;
+ // RootWindow will take care of other necessary fields.
+ root_window_->host()->PostNativeEvent(&xevent);
+ }
RunClosureAfterAllPendingUIEvents(closure);
return true;
}
« no previous file with comments | « chrome/test/base/view_event_test_base.cc ('k') | ui/views/test/ui_controls_factory_desktop_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698