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

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: Split X11EventSource and X11Window. 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_ozone.h"
6
7 #include "ui/events/event.h"
8 #include "ui/events/ozone/events_ozone.h"
9 #include "ui/events/x/events_x_utils.h"
10 #include "ui/gfx/geometry/point.h"
11
12 namespace ui {
13
14 X11WindowOzone::X11WindowOzone(PlatformWindowDelegate* delegate)
15 : X11WindowBase(delegate) {}
16
17 X11WindowOzone::~X11WindowOzone() {}
18
19 void X11WindowOzone::Create() {
20 DCHECK(X11EventSourceOzone::GetInstance());
21 X11EventSourceOzone::GetInstance()->AddXEventDispatcher(this);
22 X11WindowBase::Create();
23 }
24
25 void X11WindowOzone::SetCursor(PlatformCursor cursor) {}
26
27 bool X11WindowOzone::DispatchXEvent(XEvent* xev) {
28 if (XWindowFromXEvent(*xev) != xwindow_)
29 return false;
30
31 ProcessXWindowEvent(xev);
32 return true;
33 }
34
35 bool X11WindowOzone::CanDispatchEvent(const PlatformEvent& event) {
36 // This is broken, there is no way to include XID of XWindow in ui::Event.
sadrul 2016/02/02 16:33:54 Should this do things similar to DrmWindowHost::Ca
kylechar 2016/02/02 19:01:42 Either use that type of hack or fix things so that
37 return true;
38 }
39
40 uint32_t X11WindowOzone::DispatchEvent(const PlatformEvent& platform_event) {
41 Event* event = static_cast<Event*>(platform_event);
42 DispatchEventFromNativeUiEvent(
sadrul 2016/02/02 16:33:54 I don't think we need to use this, and instead can
kylechar 2016/02/02 19:01:42 I have no idea (I definitely copied this in from t
43 event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
44 base::Unretained(delegate_)));
45
46 return POST_DISPATCH_STOP_PROPAGATION;
47 }
48
49 } // namespace ui
OLDNEW
« ui/platform_window/x11/x11_window_base.h ('K') | « ui/platform_window/x11/x11_window_ozone.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698