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

Side by Side Diff: ui/platform_window/x11/x11_window_ozone.cc

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: XEventDispatcher added. Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/platform_window/x11/x11_window.h"
6
7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xlib.h>
9
10 #include "ui/events/event.h"
11 #include "ui/events/ozone/events_ozone.h"
12 #include "ui/events/x/events_x_utils.h"
13 #include "ui/gfx/geometry/point.h"
14
15 namespace ui {
16
17 void X11Window::SetCursor(PlatformCursor cursor) {}
18
19 void X11Window::ProcessXInput2Event(XEvent* xev) {
20 NOTREACHED();
21 }
22
23 bool X11Window::CanDispatchEvent(const PlatformEvent& event) {
24 return true;
25 }
26
27 uint32_t X11Window::DispatchEvent(const PlatformEvent& platform_event) {
28 Event* event = static_cast<Event*>(platform_event);
29 DispatchEventFromNativeUiEvent(
30 event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
31 base::Unretained(delegate_)));
32
33 return POST_DISPATCH_STOP_PROPAGATION;
34 }
35
36 bool X11Window::DispatchXEvent(const XEvent& xev) {
37 if (XWindowFromXEvent(xev) != xwindow_)
38 return false;
39
40 ProcessXWindowEvent(xev);
41 return true;
42 }
43
44 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698