Index: ui/events/x/events_x_utils.cc |
diff --git a/ui/events/x/events_x_utils.cc b/ui/events/x/events_x_utils.cc |
index fb762f5294f1d8a2081e907cf04ad91e6c323161..a5247f2cd42d58b78be8e980484c8601e8dc1ad1 100644 |
--- a/ui/events/x/events_x_utils.cc |
+++ b/ui/events/x/events_x_utils.cc |
@@ -26,7 +26,6 @@ |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/screen.h" |
#include "ui/gfx/x/x11_atom_cache.h" |
-#include "ui/gfx/x/x11_types.h" |
namespace { |
@@ -306,6 +305,13 @@ bool GetGestureTimes(const XEvent& xev, double* start_time, double* end_time) { |
namespace ui { |
+XID XWindowFromXEvent(const XEvent& xev) { |
+ XID target = xev.xany.window; |
+ if (xev.type == GenericEvent) |
+ target = static_cast<XIDeviceEvent*>(xev.xcookie.data)->event; |
+ return target; |
+} |
+ |
EventType EventTypeFromXEvent(const XEvent& xev) { |
// Allow the DeviceDataManager to block the event. If blocked return |
// ET_UNKNOWN as the type so this event will not be further processed. |