| OLD | NEW |
| 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/platform_window/x11/x11_window.h" | 5 #include "ui/platform_window/x11/x11_window.h" |
| 6 | 6 |
| 7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
| 10 | 10 |
| 11 #include "ui/events/devices/x11/touch_factory_x11.h" | 11 #include "ui/events/devices/x11/touch_factory_x11.h" |
| 12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
| 13 #include "ui/events/event_utils.h" | 13 #include "ui/events/event_utils.h" |
| 14 #include "ui/events/platform/platform_event_source.h" | 14 #include "ui/events/platform/platform_event_source.h" |
| 15 #include "ui/events/platform/x11/x11_event_source.h" | 15 #include "ui/events/platform/x11/x11_event_source.h" |
| 16 #include "ui/platform_window/platform_window_delegate.h" | 16 #include "ui/platform_window/platform_window_delegate.h" |
| 17 | 17 |
| 18 namespace ui { | 18 namespace ui { |
| 19 | 19 |
| 20 X11Window::X11Window(PlatformWindowDelegate* delegate) | 20 X11Window::X11Window(PlatformWindowDelegate* delegate, const gfx::Rect& bounds) |
| 21 : X11WindowBase(delegate) { | 21 : X11WindowBase(delegate, bounds) { |
| 22 DCHECK(PlatformEventSource::GetInstance()); | 22 DCHECK(PlatformEventSource::GetInstance()); |
| 23 PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); | 23 PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); |
| 24 } | 24 } |
| 25 | 25 |
| 26 X11Window::~X11Window() { | 26 X11Window::~X11Window() { |
| 27 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); | 27 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void X11Window::SetCursor(PlatformCursor cursor) { | 30 void X11Window::SetCursor(PlatformCursor cursor) { |
| 31 XDefineCursor(xdisplay(), xwindow(), cursor); | 31 XDefineCursor(xdisplay(), xwindow(), cursor); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 case GenericEvent: { | 139 case GenericEvent: { |
| 140 ProcessXInput2Event(xev); | 140 ProcessXInput2Event(xev); |
| 141 break; | 141 break; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 return POST_DISPATCH_STOP_PROPAGATION; | 144 return POST_DISPATCH_STOP_PROPAGATION; |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace ui | 147 } // namespace ui |
| OLD | NEW |