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

Side by Side Diff: ui/aura/test/x11_event_sender.cc

Issue 1906603002: mus: Fix event transformation in client code. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/aura/window_event_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/test/x11_event_sender.h" 5 #include "ui/aura/test/x11_event_sender.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 8
9 #include "ui/aura/window_tree_host.h" 9 #include "ui/aura/window_tree_host.h"
10 #include "ui/gfx/geometry/point.h" 10 #include "ui/gfx/geometry/point.h"
(...skipping 16 matching lines...) Expand all
27 case KeyRelease: 27 case KeyRelease:
28 case ButtonPress: 28 case ButtonPress:
29 case ButtonRelease: { 29 case ButtonRelease: {
30 // The fields used below are in the same place for all of events 30 // The fields used below are in the same place for all of events
31 // above. Using xmotion from XEvent's unions to avoid repeating 31 // above. Using xmotion from XEvent's unions to avoid repeating
32 // the code. 32 // the code.
33 event.xmotion.root = DefaultRootWindow(event.xany.display); 33 event.xmotion.root = DefaultRootWindow(event.xany.display);
34 event.xmotion.time = CurrentTime; 34 event.xmotion.time = CurrentTime;
35 35
36 gfx::Point point(event.xmotion.x, event.xmotion.y); 36 gfx::Point point(event.xmotion.x, event.xmotion.y);
37 host->ConvertPointToNativeScreen(&point); 37 gfx::Point root_point = point;
38 event.xmotion.x_root = point.x(); 38 host->ConvertPointToNativeScreen(&root_point);
39 event.xmotion.y_root = point.y(); 39 event.xmotion.x_root = root_point.x();
40 event.xmotion.y_root = root_point.y();
41 LOG(ERROR) << "Posting at " << point.ToString() << " vs. "
42 << root_point.ToString();
40 } 43 }
41 default: 44 default:
42 break; 45 break;
43 } 46 }
44 XSendEvent(xdisplay, xwindow, False, 0, &event); 47 XSendEvent(xdisplay, xwindow, False, 0, &event);
45 XFlush(xdisplay); 48 XFlush(xdisplay);
46 } 49 }
47 50
48 } // namespace test 51 } // namespace test
49 } // namespace aura 52 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/window_event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698